diff options
author | Mert Tumer <merttumer@outlook.com> | 2016-10-26 18:24:58 +0300 |
---|---|---|
committer | jan iversen <jani@documentfoundation.org> | 2016-12-06 08:31:00 +0000 |
commit | 252008d49203344ebe69e727a260a48bc76d7a82 (patch) | |
tree | bf0a72e0069cdc776b3e3e67ed9bb0220f4a8939 /android/source | |
parent | dd89c68edf7f022e1c96d0cc9e7e13cde042dd4b (diff) |
tdf#103524 - Fix Bottom Toolbars closing operation
Added variables to control state of bottom toolbars, and based
on their state open/close the bars
Change-Id: I5f9429b336451a354b95dcee18b71fb577c28559
Reviewed-on: https://gerrit.libreoffice.org/30298
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
Diffstat (limited to 'android/source')
-rwxr-xr-x | android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java index bd21fe2b5333..c04742a238e9 100755 --- a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java +++ b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java @@ -97,6 +97,8 @@ public class LibreOfficeMainActivity extends AppCompatActivity { } private boolean isKeyboardOpen = false; + private boolean isFormattingToolbarOpen = false; + private boolean isSearchToolbarOpen = false; @Override public void onCreate(Bundle savedInstanceState) { Log.w(LOGTAG, "onCreate.."); @@ -391,6 +393,8 @@ public class LibreOfficeMainActivity extends AppCompatActivity { inputMethodManager.showSoftInput(layerView, InputMethodManager.SHOW_FORCED); } isKeyboardOpen=true; + isSearchToolbarOpen=false; + isFormattingToolbarOpen=false; hideBottomToolbar(); } @@ -445,6 +449,8 @@ public class LibreOfficeMainActivity extends AppCompatActivity { findViewById(R.id.toolbar_bottom).setVisibility(View.GONE); findViewById(R.id.formatting_toolbar).setVisibility(View.GONE); findViewById(R.id.search_toolbar).setVisibility(View.GONE); + isFormattingToolbarOpen=false; + isSearchToolbarOpen=false; } }); } @@ -453,10 +459,17 @@ public class LibreOfficeMainActivity extends AppCompatActivity { LOKitShell.getMainHandler().post(new Runnable() { @Override public void run() { - showBottomToolbar(); - findViewById(R.id.formatting_toolbar).setVisibility(View.VISIBLE); - findViewById(R.id.search_toolbar).setVisibility(View.GONE); - hideSoftKeyboardDirect(); + if(isFormattingToolbarOpen == true){ + hideBottomToolbar(); + }else{ + showBottomToolbar(); + findViewById(R.id.formatting_toolbar).setVisibility(View.VISIBLE); + findViewById(R.id.search_toolbar).setVisibility(View.GONE); + hideSoftKeyboardDirect(); + isSearchToolbarOpen=false; + isFormattingToolbarOpen=true; + } + } }); } @@ -475,10 +488,16 @@ public class LibreOfficeMainActivity extends AppCompatActivity { LOKitShell.getMainHandler().post(new Runnable() { @Override public void run() { - showBottomToolbar(); - findViewById(R.id.formatting_toolbar).setVisibility(View.GONE); - findViewById(R.id.search_toolbar).setVisibility(View.VISIBLE); - hideSoftKeyboardDirect(); + if(isSearchToolbarOpen==true){ + hideBottomToolbar(); + }else{ + showBottomToolbar(); + findViewById(R.id.formatting_toolbar).setVisibility(View.GONE); + findViewById(R.id.search_toolbar).setVisibility(View.VISIBLE); + hideSoftKeyboardDirect(); + isFormattingToolbarOpen=false; + isSearchToolbarOpen=true; + } } }); } |