From 3636ca970a91ac8cdfd0c3934d6f6afee74ece40 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 23 Nov 2021 07:24:40 +0100 Subject: [PATCH] Revert "Prevent flicker" This reverts commit c1a63731330911a59fe6e7d4e8fa972f802fab9a. --- .../eu/faircode/email/FragmentMessages.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 7ce2f16b72..51f1d820e1 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -1810,6 +1810,14 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. @Override public void setExpanded(TupleMessageEx message, boolean value, boolean scroll) { + // Prevent flicker + if (value && message.accountAutoSeen) { + message.unseen = 0; + message.ui_seen = true; + message.visible_unseen = 0; + message.ui_unsnoozed = false; + } + setValue("expanded", message.id, value); if (scroll) setValue("scroll", message.id, true); @@ -5592,16 +5600,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. !EntityFolder.DRAFTS.equals(message.folderType) && !EntityFolder.TRASH.equals(message.folderType)) iProperties.setExpanded(message, true, false); - - // Prevent flicker - for (TupleMessageEx message : messages) - if (message != null && message.accountAutoSeen && - iProperties.getValue("expanded", message.id)) { - message.unseen = 0; - message.ui_seen = true; - message.visible_unseen = 0; - message.ui_unsnoozed = false; - } } else { if (autoCloseCount > 0 && (autoclose || onclose != null)) { List mt = new ArrayList<>();