diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 641929757a..ede621cc70 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -172,6 +172,18 @@ public class FragmentMessages extends FragmentBase { private static final int UNDO_TIMEOUT = 5000; // milliseconds private static final int SWIPE_DISABLE_SELECT_DURATION = 1500; // milliseconds + private static final List DUPLICATE_ORDER = Arrays.asList( + EntityFolder.INBOX, + EntityFolder.OUTBOX, + EntityFolder.DRAFTS, + EntityFolder.SENT, + EntityFolder.TRASH, + EntityFolder.JUNK, + EntityFolder.SYSTEM, + EntityFolder.USER, + EntityFolder.ARCHIVE + ); + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -2025,22 +2037,10 @@ public class FragmentMessages extends FragmentBase { List dups = duplicates.get(msgid); if (dups.size() > 1) { Collections.sort(dups, new Comparator() { - final List ORDER = Arrays.asList( - EntityFolder.INBOX, - EntityFolder.OUTBOX, - EntityFolder.DRAFTS, - EntityFolder.SENT, - EntityFolder.TRASH, - EntityFolder.JUNK, - EntityFolder.SYSTEM, - EntityFolder.USER, - EntityFolder.ARCHIVE - ); - @Override public int compare(TupleMessageEx d1, TupleMessageEx d2) { - int o1 = ORDER.indexOf(d1.folderType); - int o2 = ORDER.indexOf(d2.folderType); + int o1 = DUPLICATE_ORDER.indexOf(d1.folderType); + int o2 = DUPLICATE_ORDER.indexOf(d2.folderType); return ((Integer) o1).compareTo(o2); } });