From 61701f1e6a9d5f4e099781c8917b961dce237c45 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 23 Aug 2018 07:08:29 +0000 Subject: [PATCH] Prevent flicker --- app/src/main/java/eu/faircode/email/FragmentMessage.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessage.java b/app/src/main/java/eu/faircode/email/FragmentMessage.java index 00a7b98839..752f5ab762 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessage.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessage.java @@ -375,11 +375,17 @@ public class FragmentMessage extends FragmentEx { db.folder().liveFolders(message.account).removeObservers(getViewLifecycleOwner()); db.folder().liveFolders(message.account).observe(getViewLifecycleOwner(), new Observer>() { + private boolean once = false; + @Override public void onChanged(@Nullable List folders) { if (folders == null) folders = new ArrayList<>(); + if (once) + return; + once = true; + boolean inInbox = EntityFolder.INBOX.equals(message.folderType); boolean inOutbox = EntityFolder.OUTBOX.equals(message.folderType); boolean inArchive = EntityFolder.ARCHIVE.equals(message.folderType);