Cancel search on back

pull/199/head
M66B 4 years ago
parent a275e930da
commit c599b323b7

@ -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…
Cancel
Save