forked from amazingfate/loongoffice
This commit will add the ability to create a new document. A FAB is used in home screen which on expansion gives four options namely new writer document, new impress, new Sheet or new Draw. Two new events loadNewDocument and saveDocumentAs have been added. Another major change includes the use of constraint layout in LOUIActivity layout as it decreases nesting of views and improves the app performance. This was needed because of the new FAB layouts being added. Support for vector drawables has been enabled. Change-Id: Ia3ea17f73c0d8514f8ddb7b9a1cbd2ce7de6ac08 Reviewed-on: https://gerrit.libreoffice.org/35183 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
272 lines
10 KiB
XML
272 lines
10 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!--
|
|
This file is part of the LibreOffice project.
|
|
|
|
This Source Code Form is subject to the terms of the Mozilla Public
|
|
License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
-->
|
|
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
xmlns:tools="http://schemas.android.com/tools"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:orientation="vertical">
|
|
|
|
<!-- The toolbar -->
|
|
<android.support.v7.widget.Toolbar
|
|
android:id="@+id/toolbar"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:elevation="3dp"
|
|
android:background="@color/toolbar_background"
|
|
app:theme="@style/LibreOfficeTheme.Toolbar"
|
|
tools:theme="@style/LibreOfficeTheme.Toolbar"
|
|
app:popupTheme="@style/LibreOfficeTheme"
|
|
tools:layout_constraintTop_creator="1"
|
|
tools:layout_constraintRight_creator="1"
|
|
app:layout_constraintRight_toRightOf="parent"
|
|
tools:layout_constraintLeft_creator="1"
|
|
app:layout_constraintLeft_toLeftOf="parent"
|
|
app:layout_constraintTop_toTopOf="parent">
|
|
|
|
</android.support.v7.widget.Toolbar>
|
|
|
|
|
|
<android.support.v4.widget.DrawerLayout
|
|
android:id="@+id/drawer_layout"
|
|
android:layout_width="0dp"
|
|
android:layout_height="0dp"
|
|
tools:layout_constraintTop_creator="1"
|
|
tools:layout_constraintRight_creator="1"
|
|
tools:layout_constraintBottom_creator="1"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintRight_toRightOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@+id/toolbar"
|
|
tools:layout_constraintLeft_creator="1"
|
|
app:layout_constraintLeft_toLeftOf="parent">
|
|
|
|
<!-- The content -->
|
|
<ScrollView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent">
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="vertical"
|
|
android:divider="@color/doorhanger_divider_light"
|
|
android:showDividers="middle">
|
|
|
|
<TextView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="48dp"
|
|
android:id="@+id/header_recents"
|
|
android:text="@string/title_recents"
|
|
android:gravity="center_vertical"
|
|
android:textSize="14sp"
|
|
android:padding="16dp"
|
|
android:textStyle="bold" />
|
|
|
|
<!--Recent files-->
|
|
<android.support.v7.widget.RecyclerView
|
|
android:id="@+id/list_recent"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="8dp"
|
|
android:layout_marginBottom="8dp" />
|
|
|
|
<TextView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="48dp"
|
|
android:id="@+id/header_browser"
|
|
android:text="@string/title_browser"
|
|
android:gravity="center_vertical"
|
|
android:textSize="14sp"
|
|
android:padding="16dp"
|
|
android:textStyle="bold" />
|
|
|
|
|
|
<!--Document browser-->
|
|
<android.support.v7.widget.RecyclerView
|
|
android:id="@+id/file_recycler_view"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:background="@color/background_normal"
|
|
android:orientation="vertical" />
|
|
|
|
</LinearLayout>
|
|
|
|
</ScrollView>
|
|
|
|
<!-- The navigation drawer -->
|
|
<android.support.design.widget.NavigationView
|
|
android:id="@+id/navigation_drawer"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="match_parent"
|
|
android:layout_gravity="start"
|
|
android:background="@color/background_normal"
|
|
app:menu="@menu/navigation_menu"
|
|
android:theme="@style/LibreOfficeTheme.NavigationView" />
|
|
|
|
</android.support.v4.widget.DrawerLayout>
|
|
|
|
<android.support.design.widget.FloatingActionButton
|
|
android:id="@+id/editFAB"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginBottom="16dp"
|
|
android:layout_marginEnd="16dp"
|
|
android:layout_marginRight="16dp"
|
|
android:clickable="true"
|
|
app:fabSize="normal"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintRight_toRightOf="parent"
|
|
app:backgroundTint="@color/background_normal"
|
|
app:srcCompat="@drawable/ic_add_black_24dp" />
|
|
|
|
<LinearLayout
|
|
android:id="@+id/writerLayout"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center_vertical"
|
|
android:orientation="horizontal"
|
|
android:visibility="invisible"
|
|
app:layout_constraintBottom_toTopOf="@+id/editFAB"
|
|
app:layout_constraintRight_toRightOf="parent">
|
|
|
|
<TextView
|
|
android:id="@+id/newWriterTextView"
|
|
android:layout_width="120dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginEnd="8dp"
|
|
android:layout_marginRight="8dp"
|
|
android:elevation="2dp"
|
|
android:gravity="center_horizontal"
|
|
android:text="@string/new_write"
|
|
android:textSize="18sp"
|
|
android:textStyle="bold"
|
|
android:background="@color/background_normal"
|
|
android:typeface="normal" />
|
|
|
|
<android.support.design.widget.FloatingActionButton
|
|
android:id="@+id/newWriterFAB"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:clickable="true"
|
|
app:fabSize="normal"
|
|
app:backgroundTint="@color/background_normal"
|
|
app:srcCompat="@drawable/writer" />
|
|
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
android:id="@+id/impressLayout"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center_vertical"
|
|
android:orientation="horizontal"
|
|
android:visibility="invisible"
|
|
app:layout_constraintBottom_toTopOf="@+id/writerLayout"
|
|
app:layout_constraintLeft_toLeftOf="@+id/writerLayout"
|
|
app:layout_constraintRight_toRightOf="parent">
|
|
|
|
<TextView
|
|
android:id="@+id/newImpressTextView"
|
|
android:layout_width="120dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginEnd="8dp"
|
|
android:layout_marginRight="8dp"
|
|
android:elevation="2dp"
|
|
android:gravity="center_horizontal"
|
|
android:text="@string/new_impress"
|
|
android:textSize="18sp"
|
|
android:textStyle="bold"
|
|
android:background="@color/background_normal"
|
|
android:typeface="normal" />
|
|
|
|
<android.support.design.widget.FloatingActionButton
|
|
android:id="@+id/newImpressFAB"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:clickable="true"
|
|
app:fabSize="normal"
|
|
app:backgroundTint="@color/background_normal"
|
|
app:srcCompat="@drawable/impress" />
|
|
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
android:id="@+id/calcLayout"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center_vertical"
|
|
android:orientation="horizontal"
|
|
android:visibility="invisible"
|
|
app:layout_constraintBottom_toTopOf="@+id/impressLayout"
|
|
app:layout_constraintLeft_toLeftOf="@+id/impressLayout"
|
|
app:layout_constraintRight_toRightOf="parent">
|
|
|
|
<TextView
|
|
android:id="@+id/newCalcTextView"
|
|
android:layout_width="120dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginEnd="8dp"
|
|
android:layout_marginRight="8dp"
|
|
android:elevation="2dp"
|
|
android:gravity="center_horizontal"
|
|
android:text="@string/new_spreadsheet"
|
|
android:background="@color/background_normal"
|
|
android:textSize="18sp"
|
|
android:textStyle="bold"
|
|
android:typeface="normal" />
|
|
|
|
<android.support.design.widget.FloatingActionButton
|
|
android:id="@+id/newCalcFAB"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:clickable="true"
|
|
app:fabSize="normal"
|
|
app:backgroundTint="@color/background_normal"
|
|
app:srcCompat="@drawable/calc" />
|
|
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
android:id="@+id/drawLayout"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center_vertical"
|
|
android:orientation="horizontal"
|
|
android:visibility="invisible"
|
|
app:layout_constraintBottom_toTopOf="@+id/calcLayout"
|
|
app:layout_constraintLeft_toLeftOf="@+id/calcLayout"
|
|
app:layout_constraintRight_toRightOf="parent">
|
|
|
|
<TextView
|
|
android:id="@+id/newDrawTextView"
|
|
android:layout_width="120dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginEnd="8dp"
|
|
android:layout_marginRight="8dp"
|
|
android:elevation="2dp"
|
|
android:gravity="center_horizontal"
|
|
android:text="@string/new_draw"
|
|
android:background="@color/background_normal"
|
|
android:textSize="18sp"
|
|
android:textStyle="bold"
|
|
android:typeface="normal" />
|
|
|
|
<android.support.design.widget.FloatingActionButton
|
|
android:id="@+id/newDrawFAB"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:clickable="true"
|
|
app:fabSize="normal"
|
|
app:backgroundTint="@color/background_normal"
|
|
app:srcCompat="@drawable/draw" />
|
|
|
|
</LinearLayout>
|
|
|
|
</android.support.constraint.ConstraintLayout>
|