From af4734c9a9c28be82486a07ecaa97fc3b37a2b46 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 21 Jun 2020 20:31:47 +0200 Subject: [PATCH] Hide delete all on selection --- app/src/main/java/eu/faircode/email/FragmentMessages.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 35800c9228..ecfde4831f 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -3477,8 +3477,9 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. menu.findItem(R.id.menu_sort_on_snoozed).setVisible(false); } - menu.findItem(R.id.menu_empty_trash).setVisible(EntityFolder.TRASH.equals(type) && folder); - menu.findItem(R.id.menu_empty_spam).setVisible(EntityFolder.JUNK.equals(type) && folder); + boolean unselected = (selectionTracker == null || !selectionTracker.hasSelection()); + menu.findItem(R.id.menu_empty_trash).setVisible(EntityFolder.TRASH.equals(type) && folder && unselected); + menu.findItem(R.id.menu_empty_spam).setVisible(EntityFolder.JUNK.equals(type) && folder && unselected); if ("time".equals(sort)) menu.findItem(R.id.menu_sort_on_time).setChecked(true);