diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2014-10-26 01:54:12 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2014-10-26 01:54:12 +0200 |
commit | d6b9fc27b72683cbb5dfe548f863df789fbb5345 (patch) | |
tree | 49d424282a97efbf8924d48793dd117f1113b9ea /OpenKeychain/src/main/java | |
parent | 510ef40f556e59c37f42578ba8cb243f17f7e4e4 (diff) | |
parent | 305900799546da6b45e327c3480975c860af84e1 (diff) | |
download | open-keychain-d6b9fc27b72683cbb5dfe548f863df789fbb5345.tar.gz open-keychain-d6b9fc27b72683cbb5dfe548f863df789fbb5345.tar.bz2 open-keychain-d6b9fc27b72683cbb5dfe548f863df789fbb5345.zip |
Merge branch 'development' of github.com:open-keychain/open-keychain into development
Diffstat (limited to 'OpenKeychain/src/main/java')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysCloudFragment.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysCloudFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysCloudFragment.java index 3db0628ab..03aba344a 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysCloudFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysCloudFragment.java @@ -50,7 +50,6 @@ public class ImportKeysCloudFragment extends Fragment { private View mSearchButton; private AutoCompleteTextView mQueryEditText; private View mConfigButton; - private ArrayAdapter<String> mServerAdapter; /** * Creates new instance of this fragment @@ -136,11 +135,7 @@ public class ImportKeysCloudFragment extends Fragment { } else { // open keyboard mQueryEditText.requestFocus(); - InputMethodManager inputMethodManager = (InputMethodManager) - getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); - if (inputMethodManager != null) { - inputMethodManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); - } + toggleKeyboard(true); } if (getArguments().getBoolean(ARG_DISABLE_QUERY_EDIT, false)) { @@ -159,10 +154,10 @@ public class ImportKeysCloudFragment extends Fragment { private void search(String query) { Preferences prefs = Preferences.getPreferences(getActivity()); mImportActivity.loadCallback(new ImportKeysListFragment.CloudLoaderState(query, prefs.getCloudSearchPrefs())); - hideKeyboard(); + toggleKeyboard(false); } - private void hideKeyboard() { + private void toggleKeyboard(boolean show) { if (getActivity() == null) { return; } @@ -171,10 +166,15 @@ public class ImportKeysCloudFragment extends Fragment { // check if no view has focus View v = getActivity().getCurrentFocus(); - if (v == null) + if (v == null) { return; + } - inputManager.hideSoftInputFromWindow(v.getWindowToken(), 0); + if (show) { + inputManager.showSoftInput(v, InputMethodManager.SHOW_IMPLICIT); + } else { + inputManager.hideSoftInputFromWindow(v.getWindowToken(), 0); + } } } |