From 78098b8494be7123bc4a8b50faa13445e5afd8ce Mon Sep 17 00:00:00 2001 From: brainbreaker Date: Mon, 27 Mar 2017 22:26:47 +0530 Subject: Add BottomSheetBehavior to formatting toolbar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds the BottomSheetBehavior to the formatting toolbar appearing from bottom. CoordinatorLayout replaces the RelativeLayout in activity_main and bottom toolbar is made the child of it. Also, Add 'adjustPan' option to LibreOfficeMainActivity's windowSoftInputMode flag so as to prevent soft keyboard from pushing the views up Change-Id: Ic9999c1177ac238bc7c482a69daec4e629fe6d93 Reviewed-on: https://gerrit.libreoffice.org/35768 Reviewed-by: Tomaž Vajngerl Tested-by: Tomaž Vajngerl --- android/source/AndroidManifest.xml | 2 +- android/source/res/layout/activity_main.xml | 8 ++--- android/source/res/layout/toolbar_bottom.xml | 5 +++- .../org/libreoffice/LibreOfficeMainActivity.java | 35 ++++++++++++---------- 4 files changed, 29 insertions(+), 21 deletions(-) (limited to 'android') diff --git a/android/source/AndroidManifest.xml b/android/source/AndroidManifest.xml index d0fde624572d..56fe63d62008 100644 --- a/android/source/AndroidManifest.xml +++ b/android/source/AndroidManifest.xml @@ -25,7 +25,7 @@ android:name=".LibreOfficeMainActivity" android:label="@string/app_name" android:configChanges="orientation|keyboard|keyboardHidden|screenLayout|uiMode|screenSize|smallestScreenSize" - android:windowSoftInputMode="adjustResize" > + android:windowSoftInputMode="adjustPan|adjustResize" > diff --git a/android/source/res/layout/activity_main.xml b/android/source/res/layout/activity_main.xml index 923ed5644595..1ad3e3836f24 100644 --- a/android/source/res/layout/activity_main.xml +++ b/android/source/res/layout/activity_main.xml @@ -6,9 +6,10 @@ android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#fff" - tools:context=".LibreOfficeMainActivity" > + tools:context=".LibreOfficeMainActivity"> - @@ -27,7 +28,6 @@ @@ -69,7 +69,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"/> - + + tools:showIn="@layout/activity_main" + app:layout_behavior="android.support.design.widget.BottomSheetBehavior" + app:behavior_hideable="true" + app:behavior_peekHeight="0dp">