From 40acdfc25211c7851366b8f2bc1fb73660d6e078 Mon Sep 17 00:00:00 2001 From: kelson42 Date: Sat, 9 Nov 2013 15:13:15 +0100 Subject: [PATCH] + at file loading, show the searchbar, but not the keyboard --- .../kiwixmobile/KiwixMobileActivity.java | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/org/kiwix/kiwixmobile/KiwixMobileActivity.java b/src/org/kiwix/kiwixmobile/KiwixMobileActivity.java index 3c6a554b4..2f650665a 100644 --- a/src/org/kiwix/kiwixmobile/KiwixMobileActivity.java +++ b/src/org/kiwix/kiwixmobile/KiwixMobileActivity.java @@ -500,15 +500,22 @@ public class KiwixMobileActivity extends Activity { } + private void showSearchBar() { + showSearchBar(true); + } - - private void showSearchBar() { + private void showSearchBar(Boolean focus) { articleSearchBar.setVisibility(View.VISIBLE); - articleSearchtextView.requestFocus(); - //Move cursor to end - articleSearchtextView.setSelection(articleSearchtextView.getText().length()); - InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); - imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0); + + if (focus) { + articleSearchtextView.requestFocus(); + + //Move cursor to end + articleSearchtextView.setSelection(articleSearchtextView.getText().length()); + + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0); + } } @@ -577,7 +584,7 @@ public class KiwixMobileActivity extends Activity { requestInitAllMenuItems = true; } openMainPage(); - showSearchBar(); + showSearchBar(false); return true; } else { Toast.makeText(this, getResources().getString(R.string.error_fileinvalid), Toast.LENGTH_LONG).show();