diff options
author | Nikhil Peter Raj <nikhilpeter93@gmail.com> | 2014-03-08 15:28:46 +0530 |
---|---|---|
committer | Nikhil Peter Raj <nikhilpeter93@gmail.com> | 2014-03-08 15:28:46 +0530 |
commit | b29c430959d4da2f6c99693d2fd138124d4736f8 (patch) | |
tree | 2d4b7eebde6ad77f5cffea3522146a111771fe8f /OpenPGP-Keychain/src/main/java | |
parent | 0a0bdad5b5b067ff8b091c4d184b7cc1ee1c46d1 (diff) | |
download | open-keychain-b29c430959d4da2f6c99693d2fd138124d4736f8.tar.gz open-keychain-b29c430959d4da2f6c99693d2fd138124d4736f8.tar.bz2 open-keychain-b29c430959d4da2f6c99693d2fd138124d4736f8.zip |
Fix for #347
Diffstat (limited to 'OpenPGP-Keychain/src/main/java')
-rw-r--r-- | OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java index 3418fff85..e1c43919f 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java @@ -353,12 +353,23 @@ public class KeyListPublicFragment extends Fragment implements SearchView.OnQuer @Override public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) { // Get the searchview - MenuItem searchItem = menu.findItem(R.id.menu_key_list_public_search); + final MenuItem searchItem = menu.findItem(R.id.menu_key_list_public_search); + mSearchView = (SearchView) MenuItemCompat.getActionView(searchItem); // Execute this when searching mSearchView.setOnQueryTextListener(this); + //Collapse the SearchView if it does not have focus + mSearchView.setOnQueryTextFocusChangeListener(new View.OnFocusChangeListener() { + @Override + public void onFocusChange(View v, boolean hasFocus) { + if (!hasFocus) { + MenuItemCompat.collapseActionView(searchItem); + } + } + }); + super.onCreateOptionsMenu(menu, inflater); } |