Browse Source

Prevent flicker

main
M66B 6 years ago
parent
commit
61701f1e6a
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      app/src/main/java/eu/faircode/email/FragmentMessage.java

+ 6
- 0
app/src/main/java/eu/faircode/email/FragmentMessage.java View File

@ -375,11 +375,17 @@ public class FragmentMessage extends FragmentEx {
db.folder().liveFolders(message.account).removeObservers(getViewLifecycleOwner()); db.folder().liveFolders(message.account).removeObservers(getViewLifecycleOwner());
db.folder().liveFolders(message.account).observe(getViewLifecycleOwner(), new Observer<List<TupleFolderEx>>() { db.folder().liveFolders(message.account).observe(getViewLifecycleOwner(), new Observer<List<TupleFolderEx>>() {
private boolean once = false;
@Override @Override
public void onChanged(@Nullable List<TupleFolderEx> folders) { public void onChanged(@Nullable List<TupleFolderEx> folders) {
if (folders == null) if (folders == null)
folders = new ArrayList<>(); folders = new ArrayList<>();
if (once)
return;
once = true;
boolean inInbox = EntityFolder.INBOX.equals(message.folderType); boolean inInbox = EntityFolder.INBOX.equals(message.folderType);
boolean inOutbox = EntityFolder.OUTBOX.equals(message.folderType); boolean inOutbox = EntityFolder.OUTBOX.equals(message.folderType);
boolean inArchive = EntityFolder.ARCHIVE.equals(message.folderType); boolean inArchive = EntityFolder.ARCHIVE.equals(message.folderType);


Loading…
Cancel
Save