diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-01-13 17:28:13 +0900 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-01-16 13:18:27 +0100 |
commit | 5291c6372df1e04f53a2de13d91108f8ba2cfc31 (patch) | |
tree | e4066408ae9b10d17609c468e0ab33e0aac84b63 /android | |
parent | 6dabfea7407cb2218407e1ce867d74f96db60516 (diff) |
android: add method to force showing of soft keyboard
Change-Id: Iadf2ed580b75b2b1fcb0067617a2d79ca707d54a
Diffstat (limited to 'android')
-rw-r--r-- | android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerView.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerView.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerView.java index b59bba888300..0d2b0676e94c 100644 --- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerView.java +++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerView.java @@ -24,6 +24,7 @@ import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputConnection; +import android.view.inputmethod.InputMethodManager; import android.widget.FrameLayout; import org.libreoffice.LibreOfficeMainActivity; @@ -350,6 +351,15 @@ public class LayerView extends FrameLayout { } } + public void showSoftKeyboard() { + View view = mSurfaceView != null ? mSurfaceView : mTextureView; + + if (view.requestFocus()) { + InputMethodManager inputMethodManager = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); + inputMethodManager.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT); + } + } + private class SurfaceTextureListener implements TextureView.SurfaceTextureListener { public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) { // We don't do this for surfaceCreated above because it is always followed by a surfaceChanged, |