[Libreoffice-commits] core.git: android/source
Mert Tumer
merttumer at outlook.com
Fri Sep 9 08:18:23 UTC 2016
android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java | 11 ++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
New commits:
commit fbda3f9a8d2d3f2ccd7999a3f110c56bce38c1d8
Author: Mert Tumer <merttumer at outlook.com>
Date: Tue Aug 9 17:16:11 2016 +0300
tdf#96810 - Fix Android Viewer: Keyboard can not hide with keyboard button.
Change-Id: I87d83953094d31ed4e1bcf60c55dd19056a7994e
Reviewed-on: https://gerrit.libreoffice.org/28005
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: jan iversen <jani at documentfoundation.org>
diff --git a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
index 1cbdabb..bd21fe2 100755
--- a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -96,6 +96,7 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
return mTempFile != null;
}
+ private boolean isKeyboardOpen = false;
@Override
public void onCreate(Bundle savedInstanceState) {
Log.w(LOGTAG, "onCreate..");
@@ -368,13 +369,18 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
* Show software keyboard.
* Force the request on main thread.
*/
+
+
public void showSoftKeyboard() {
+
LOKitShell.getMainHandler().post(new Runnable() {
@Override
public void run() {
- showSoftKeyboardDirect();
+ if(!isKeyboardOpen) showSoftKeyboardDirect();
+ else hideSoftKeyboardDirect();
}
});
+
}
private void showSoftKeyboardDirect() {
@@ -384,7 +390,7 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
InputMethodManager inputMethodManager = (InputMethodManager) getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.showSoftInput(layerView, InputMethodManager.SHOW_FORCED);
}
-
+ isKeyboardOpen=true;
hideBottomToolbar();
}
@@ -419,6 +425,7 @@ public class LibreOfficeMainActivity extends AppCompatActivity {
if (getCurrentFocus() != null) {
InputMethodManager inputMethodManager = (InputMethodManager) getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
+ isKeyboardOpen=false;
}
}
More information about the Libreoffice-commits
mailing list