mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-23 22:51:02 +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);
|
etSearch.setActionEnabled(hasNext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isSearching() {
|
||||||
|
return (searchView != null);
|
||||||
|
}
|
||||||
|
|
||||||
private void clearSearch() {
|
private void clearSearch() {
|
||||||
if (searchView != null)
|
if (searchView != null)
|
||||||
searchView.clearComposingText();
|
searchView.clearComposingText();
|
||||||
|
@ -6013,6 +6017,11 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBackPressed() {
|
public boolean onBackPressed() {
|
||||||
|
if (isSearching()) {
|
||||||
|
endSearch();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (selectionTracker != null && selectionTracker.hasSelection()) {
|
if (selectionTracker != null && selectionTracker.hasSelection()) {
|
||||||
selectionTracker.clearSelection();
|
selectionTracker.clearSelection();
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue