From ed08936b62ab7db5b49846e937b17150e423f484 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 29 Nov 2021 19:06:51 +0100 Subject: [PATCH] Allow swipe left/right for seen/flag for read-only folders --- .../main/java/eu/faircode/email/FragmentMessages.java | 10 ++++++++-- 1 file changed, 8 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 6d35259ae8..23d52a4a38 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -2132,8 +2132,14 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. if (message.uid == null && message.accountProtocol == EntityAccount.TYPE_IMAP) return 0; - if (message.folderReadOnly) - return 0; + if (message.folderReadOnly) { + if (!EntityMessage.SWIPE_ACTION_SEEN.equals(swipes.swipe_left) && + !EntityMessage.SWIPE_ACTION_FLAG.equals(swipes.swipe_left)) + swipes.swipe_left = null; + if (!EntityMessage.SWIPE_ACTION_SEEN.equals(swipes.swipe_right) && + !EntityMessage.SWIPE_ACTION_FLAG.equals(swipes.swipe_right)) + swipes.swipe_right = null; + } if (message.accountProtocol != EntityAccount.TYPE_IMAP) return makeMovementFlags(0, ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT);