mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-22 22:21:18 +00:00
Cancel search on back
This commit is contained in:
parent
a275e930da
commit
c599b323b7
1 changed files with 9 additions and 0 deletions
|
@ -5933,6 +5933,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
etSearch.setActionEnabled(hasNext);
|
||||
}
|
||||
|
||||
private boolean isSearching() {
|
||||
return (searchView != null);
|
||||
}
|
||||
|
||||
private void clearSearch() {
|
||||
if (searchView != null)
|
||||
searchView.clearComposingText();
|
||||
|
@ -6013,6 +6017,11 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
|
||||
@Override
|
||||
public boolean onBackPressed() {
|
||||
if (isSearching()) {
|
||||
endSearch();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (selectionTracker != null && selectionTracker.hasSelection()) {
|
||||
selectionTracker.clearSelection();
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue