From c9537ce1203e7683d7d9e6a28e7eb8a76f79c4f3 Mon Sep 17 00:00:00 2001 From: Rashiq Date: Sun, 7 Jun 2015 12:55:31 +0200 Subject: [PATCH] Improve ActionMode --- res/layout/webview_search.xml | 3 ++- .../kiwixmobile/CompatFindActionModeCallback.java | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/res/layout/webview_search.xml b/res/layout/webview_search.xml index 4664ec9f8..320b9446e 100644 --- a/res/layout/webview_search.xml +++ b/res/layout/webview_search.xml @@ -27,10 +27,11 @@ android:scrollHorizontally="true" android:inputType="text" android:hint="@string/search_label" + android:focusableInTouchMode="true" android:textColorHint="@color/hint_foreground_material_dark" android:textColor="@android:color/white" android:imeOptions="actionDone|flagNoExtractUi|flagNoFullscreen" - android:layout_marginEnd="10dip"> + android:layout_marginRight="10dip"> diff --git a/src/org/kiwix/kiwixmobile/CompatFindActionModeCallback.java b/src/org/kiwix/kiwixmobile/CompatFindActionModeCallback.java index a3a4c4954..41fe5ea62 100644 --- a/src/org/kiwix/kiwixmobile/CompatFindActionModeCallback.java +++ b/src/org/kiwix/kiwixmobile/CompatFindActionModeCallback.java @@ -141,7 +141,15 @@ public class CompatFindActionModeCallback // Show on screen keyboard public void showSoftInput() { - mInput.showSoftInput(mEditText, 0); + mEditText.requestFocus(); + mEditText.setFocusable(true); + mEditText.setFocusableInTouchMode(true); + mEditText.requestFocusFromTouch(); + + + if (mEditText.requestFocus()) { + mInput.showSoftInput(mEditText, InputMethodManager.SHOW_IMPLICIT); + } } @Override