diff options
author | Mert Tumer <merttumer@outlook.com> | 2016-08-09 17:16:11 +0300 |
---|---|---|
committer | jan iversen <jani@documentfoundation.org> | 2016-09-09 08:16:55 +0000 |
commit | fbda3f9a8d2d3f2ccd7999a3f110c56bce38c1d8 (patch) | |
tree | 6a21464389524fbca925285f8c43a8c974222628 /android | |
parent | 52e9cab97dbd7caded0eb63d33ccf12ec61aaec6 (diff) |
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@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Diffstat (limited to 'android')
-rwxr-xr-x | android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java index 1cbdabb32edf..bd21fe2b5333 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; } } |