diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2014-09-28 03:38:14 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2014-09-28 03:38:14 +0200 |
commit | 4782d22e264481ef53432d08e79565bc4bc7b2c6 (patch) | |
tree | 74ad6f937c0c9a687e8b64fcf903415cf95e2010 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui | |
parent | 1c3d0a58eaaf7bb56d8b274f869d99b318e3daac (diff) | |
parent | d20f657151b038c25dc071dd9d227380d09ff866 (diff) | |
download | open-keychain-4782d22e264481ef53432d08e79565bc4bc7b2c6.tar.gz open-keychain-4782d22e264481ef53432d08e79565bc4bc7b2c6.tar.bz2 open-keychain-4782d22e264481ef53432d08e79565bc4bc7b2c6.zip |
Merge branch 'master' of github.com:open-keychain/open-keychain
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui')
2 files changed, 14 insertions, 3 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyInputFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyInputFragment.java index 32adba4e2..12887eca5 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyInputFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyInputFragment.java @@ -22,12 +22,10 @@ import android.os.Bundle; import android.support.v4.app.Fragment; import android.text.Editable; import android.text.TextWatcher; -import android.text.method.TextKeyListener; import android.util.Patterns; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodManager; import android.widget.ArrayAdapter; import android.widget.AutoCompleteTextView; @@ -171,7 +169,7 @@ public class CreateKeyInputFragment extends Fragment { InputMethodManager inputManager = (InputMethodManager) getActivity() .getSystemService(Context.INPUT_METHOD_SERVICE); - //check if no view has focus: + // check if no view has focus View v = getActivity().getCurrentFocus(); if (v == null) return; 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 40a60f119..2b5a9793c 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysCloudFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysCloudFragment.java @@ -155,6 +155,19 @@ public class ImportKeysCloudFragment extends Fragment { private void search(String query) { Preferences prefs = Preferences.getPreferences(getActivity()); mImportActivity.loadCallback(new ImportKeysListFragment.CloudLoaderState(query, prefs.getCloudSearchPrefs())); + hideKeyboard(); + } + + private void hideKeyboard() { + InputMethodManager inputManager = (InputMethodManager) getActivity() + .getSystemService(Context.INPUT_METHOD_SERVICE); + + // check if no view has focus + View v = getActivity().getCurrentFocus(); + if (v == null) + return; + + inputManager.hideSoftInputFromWindow(v.getWindowToken(), 0); } } |