From 32b0f234623a682e0dfc568d0978fa096194aa4d Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 25 Oct 2018 06:11:14 +0000 Subject: [PATCH] Clear selection on back --- .../main/java/eu/faircode/email/FragmentMessages.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index c8f6d957..2f462ded 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -661,6 +661,17 @@ public class FragmentMessages extends FragmentEx { } }); + ((ActivityBase) getActivity()).addBackPressedListener(new ActivityBase.IBackPressedListener() { + @Override + public boolean onBackPressed() { + if (selectionTracker != null && selectionTracker.hasSelection()) { + selectionTracker.clearSelection(); + return true; + } + return false; + } + }); + // Initialize tvNoEmail.setVisibility(View.GONE); bottom_navigation.setVisibility(View.GONE);