summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2020-02-20 21:35:57 +0100
committerJan Holesovsky <kendy@collabora.com>2020-02-21 13:51:40 +0100
commitdb201f81d95516ebd99773f6df00588e879b4e0c (patch)
tree356e0682da48ec3dd3995dfd5d25c704a5ad8e78
parente1338035ce1653e7fb7f2ba8360e5c4b51969804 (diff)
android shell: Clean up the navigation menu's appearance.
And add a hint to the user what to do when there are no recent files. Change-Id: Ic9e560b782a67b0a3f3bf622f16883cd1673c8df
-rw-r--r--android/app/src/main/res/layout/activity_document_browser.xml398
-rw-r--r--android/app/src/main/res/values/strings.xml2
2 files changed, 212 insertions, 188 deletions
diff --git a/android/app/src/main/res/layout/activity_document_browser.xml b/android/app/src/main/res/layout/activity_document_browser.xml
index 0611557fe..3e4fb298a 100644
--- a/android/app/src/main/res/layout/activity_document_browser.xml
+++ b/android/app/src/main/res/layout/activity_document_browser.xml
@@ -7,110 +7,243 @@
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout 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 -->
- <androidx.appcompat.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">
-
- </androidx.appcompat.widget.Toolbar>
-
-
<androidx.drawerlayout.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"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintRight_toRightOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/toolbar"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ tools:layout_constraintBottom_creator="1"
tools:layout_constraintLeft_creator="1"
- app:layout_constraintLeft_toLeftOf="parent">
+ tools:layout_constraintRight_creator="1"
+ tools:layout_constraintTop_creator="1">
<!-- The content -->
- <androidx.core.widget.NestedScrollView
+
+ <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:layout_weight="1">
- <LinearLayout
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical"
- android:divider="@color/doorhanger_divider_light"
- android:showDividers="middle">
+ android:background="@color/toolbar_background"
+ android:elevation="3dp"
+ app:layout_constraintTop_toTopOf="parent"
+ app:popupTheme="@style/LibreOfficeTheme"
+ app:theme="@style/LibreOfficeTheme.Toolbar"
+ tools:layout_constraintLeft_creator="1"
+ tools:layout_constraintRight_creator="1"
+ tools:layout_constraintTop_creator="1"
+ tools:theme="@style/LibreOfficeTheme.Toolbar">
+
+ </androidx.appcompat.widget.Toolbar>
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/toolbar">
<LinearLayout
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="horizontal">
+ android:layout_height="0dp"
+ android:orientation="vertical">
- <TextView
- android:id="@+id/header_recents"
+ <LinearLayout
android:layout_width="match_parent"
- android:layout_height="48dp"
- android:layout_weight="1"
- android:gravity="center_vertical"
- android:padding="16dp"
- android:text="@string/title_recents"
- android:textSize="14sp"
- android:textStyle="bold" />
-
- <ImageView
- android:id="@+id/recent_list_or_grid"
- android:layout_width="96dp"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:scaleType="centerInside"
- app:srcCompat="@drawable/ic_list_black_24dp" />
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:id="@+id/header_recents"
+ android:layout_width="match_parent"
+ android:layout_height="48dp"
+ android:layout_weight="1"
+ android:gravity="center_vertical"
+ android:padding="16dp"
+ android:text="@string/title_recents"
+ android:textSize="14sp"
+ android:textStyle="bold" />
+
+ <ImageView
+ android:id="@+id/recent_list_or_grid"
+ android:layout_width="96dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:scaleType="centerInside"
+ app:srcCompat="@drawable/ic_list_black_24dp" />
+ </LinearLayout>
+
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <androidx.recyclerview.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" >
+
+ </androidx.recyclerview.widget.RecyclerView>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginTop="16dp"
+ android:orientation="horizontal">
+
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="3" />
+
+ <TextView
+ android:id="@+id/no_recent_items_msg"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="2"
+ android:text="@string/no_recent_items"
+ android:textAlignment="center"
+ android:textSize="14sp" />
+
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="3" />
+ </LinearLayout>
+
+ </FrameLayout>
+
</LinearLayout>
+ </ScrollView>
- <!--Recent files-->
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/editFAB"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:clickable="true"
+ android:focusable="true"
+ android:visibility="invisible"
+ app:backgroundTint="@color/background_normal"
+ app:fabSize="normal"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintRight_toRightOf="parent"
+ app:srcCompat="@drawable/ic_add_black_24dp"
+ app:useCompatPadding="true" />
- <androidx.recyclerview.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" />
+ <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="@id/editFAB"
+ tools:visibility="visible">
+
+ <TextView
+ android:id="@+id/newWriterTextView"
+ style="@style/NewDocumentTextView"
+ android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
+ android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
+ android:text="@string/new_textdocument" />
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/newWriterFAB"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
+ android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
+ android:clickable="true"
+ android:focusable="true"
+ app:backgroundTint="@color/background_normal"
+ app:fabSize="mini"
+ app:srcCompat="@drawable/writer"
+ app:useCompatPadding="true" />
- <TextView
- android:id="@+id/no_recent_items_msg"
- android:layout_width="wrap_content"
- android:layout_height="48dp"
- android:layout_gravity="center"
- android:gravity="center"
- android:textSize="14sp"
- android:text="@string/no_recent_items" />
+ </LinearLayout>
- </FrameLayout>
+ <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_constraintRight_toRightOf="@id/editFAB"
+ tools:visibility="visible">
+
+ <TextView
+ android:id="@+id/newImpressTextView"
+ style="@style/NewDocumentTextView"
+ android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
+ android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
+ android:text="@string/new_presentation" />
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/newImpressFAB"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
+ android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
+ android:clickable="true"
+ android:focusable="true"
+ app:backgroundTint="@color/background_normal"
+ app:fabSize="mini"
+ app:srcCompat="@drawable/impress"
+ app:useCompatPadding="true" />
</LinearLayout>
- </androidx.core.widget.NestedScrollView>
+ <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_constraintRight_toRightOf="@id/editFAB"
+ tools:visibility="visible">
+
+ <TextView
+ android:id="@+id/newCalcTextView"
+ style="@style/NewDocumentTextView"
+ android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
+ android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
+ android:text="@string/new_spreadsheet" />
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/newCalcFAB"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
+ android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
+ android:clickable="true"
+ android:focusable="true"
+ app:backgroundTint="@color/background_normal"
+ app:fabSize="mini"
+ app:srcCompat="@drawable/calc"
+ app:useCompatPadding="true" />
+
+ </LinearLayout>
+
+ </androidx.constraintlayout.widget.ConstraintLayout>
<!-- The navigation drawer -->
<com.google.android.material.navigation.NavigationView
@@ -119,118 +252,9 @@
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:theme="@style/LibreOfficeTheme.NavigationView"
+ app:menu="@menu/navigation_menu" />
</androidx.drawerlayout.widget.DrawerLayout>
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:id="@+id/editFAB"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:clickable="true"
- android:visibility="invisible"
- app:backgroundTint="@color/background_normal"
- app:fabSize="normal"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintRight_toRightOf="parent"
- app:srcCompat="@drawable/ic_add_black_24dp"
- app:useCompatPadding="true" />
-
- <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="@id/editFAB"
- tools:visibility="visible">
-
- <TextView
- android:id="@+id/newWriterTextView"
- style="@style/NewDocumentTextView"
- android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
- android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
- android:text="@string/new_textdocument" />
-
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:id="@+id/newWriterFAB"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
- android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
- android:clickable="true"
- app:backgroundTint="@color/background_normal"
- app:fabSize="mini"
- app:srcCompat="@drawable/writer"
- app:useCompatPadding="true" />
-
- </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_constraintRight_toRightOf="@id/editFAB"
- tools:visibility="visible">
-
- <TextView
- android:id="@+id/newImpressTextView"
- style="@style/NewDocumentTextView"
- android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
- android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
- android:text="@string/new_presentation" />
-
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:id="@+id/newImpressFAB"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
- android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
- android:clickable="true"
- app:backgroundTint="@color/background_normal"
- app:fabSize="mini"
- app:srcCompat="@drawable/impress"
- app:useCompatPadding="true" />
-
- </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"
- tools:visibility="visible"
- app:layout_constraintBottom_toTopOf="@+id/impressLayout"
- app:layout_constraintRight_toRightOf="@id/editFAB">
-
- <TextView
- android:id="@+id/newCalcTextView"
- style="@style/NewDocumentTextView"
- android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
- android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
- android:text="@string/new_spreadsheet" />
-
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:id="@+id/newCalcFAB"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
- android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
- android:clickable="true"
- app:backgroundTint="@color/background_normal"
- app:fabSize="mini"
- app:srcCompat="@drawable/calc"
- app:useCompatPadding="true" />
-
- </LinearLayout>
-
-</androidx.constraintlayout.widget.ConstraintLayout>
+</LinearLayout>
diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml
index 4776a5b97..663779278 100644
--- a/android/app/src/main/res/values/strings.xml
+++ b/android/app/src/main/res/values/strings.xml
@@ -6,7 +6,7 @@
<string name="app_description">$APP_NAME is a modern, easy-to-use, open source productivity suite for word processing, spreadsheets, presentations and more.</string>
<string name="app_vendor">This release was supplied by $VENDOR.</string>
- <string name="no_recent_items">No recent items</string>
+ <string name="no_recent_items">Please open a file using the folder icon in the toolbar.</string>
<string name="no_items">No items</string>
<string name="temp_file_saving_disabled">This file is read-only, saving is disabled.</string>
<string name="file_exists_warning">A file with this name already exists, and will be overwritten.</string>