mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 19:22:14 -05:00
Revised fix for #347
This commit is contained in:
parent
b29c430959
commit
14b3807811
@ -353,22 +353,12 @@ public class KeyListPublicFragment extends Fragment implements SearchView.OnQuer
|
||||
@Override
|
||||
public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) {
|
||||
// Get the searchview
|
||||
final MenuItem searchItem = menu.findItem(R.id.menu_key_list_public_search);
|
||||
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user