summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorXimeng Zu <uznomis@yahoo.com>2017-04-25 09:22:50 -0500
committerTomaž Vajngerl <quikee@gmail.com>2017-05-09 19:45:33 +0200
commit5c2833c4edf88ab7f9ad9b6165829c149432aae5 (patch)
tree9175595ecb088ee4feb01e84e2b99e14b5ece029 /android
parenta7851b522cd0e33c391037c1aaa901b8d675ad7a (diff)
tdf#107415 android: appbar invisible on lower version
Rearranged activity_main.xml in order to fix the bug of app bar invisible on lower versions of Android devices. Change-Id: Ic4ec9435ce9ef55a2596600c143114c899c30ac2 Reviewed-on: https://gerrit.libreoffice.org/36950 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'android')
-rw-r--r--android/source/res/layout/activity_main.xml33
-rwxr-xr-xandroid/source/src/java/org/libreoffice/LibreOfficeMainActivity.java2
2 files changed, 21 insertions, 14 deletions
diff --git a/android/source/res/layout/activity_main.xml b/android/source/res/layout/activity_main.xml
index 1ad3e3836f24..bfa575b57f36 100644
--- a/android/source/res/layout/activity_main.xml
+++ b/android/source/res/layout/activity_main.xml
@@ -13,24 +13,28 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
- <android.support.v7.widget.Toolbar
- android:id="@+id/toolbar"
- android:layout_width="match_parent"
- 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" />
-
- <include layout="@layout/toolbar_bottom"/>
-
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_below="@+id/toolbar"
android:orientation="vertical">
+ <android.support.design.widget.AppBarLayout
+ android:id="@+id/appBar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <android.support.v7.widget.Toolbar
+ android:id="@+id/toolbar"
+ android:layout_width="match_parent"
+ android:layout_height="?attr/actionBarSize"
+ android:elevation="3dp"
+ android:background="@color/toolbar_background"
+ app:theme="@style/LibreOfficeTheme.Toolbar"
+ tools:theme="@style/LibreOfficeTheme.Toolbar"
+ app:popupTheme="@style/LibreOfficeTheme" />
+
+ </android.support.design.widget.AppBarLayout>
+
<RelativeLayout
android:id="@+id/gecko_layout"
android:layout_width="match_parent"
@@ -50,6 +54,8 @@
</RelativeLayout>
</LinearLayout>
+ <include layout="@layout/toolbar_bottom"/>
+
<RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="match_parent"
@@ -65,6 +71,7 @@
</RelativeLayout>
+ <!--What's the use of this view? Can it be removed?-->
<View
android:layout_width="match_parent"
android:layout_height="match_parent"/>
diff --git a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
index 6a0d033b530f..b653c437c644 100755
--- a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -560,6 +560,7 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
hideBottomToolbar();
} else {
showBottomToolbar();
+ findViewById(R.id.search_toolbar).setVisibility(View.GONE);
findViewById(R.id.formatting_toolbar).setVisibility(View.VISIBLE);
hideSoftKeyboardDirect();
isSearchToolbarOpen=false;
@@ -649,7 +650,6 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
public void openDrawer() {
mDrawerLayout.openDrawer(mDrawerList);
hideBottomToolbar();
- hideFormattingToolbar();
}
public void showAbout() {