1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-19 05:38:31 +00:00

Use trash if no archive for right swipe target

This commit is contained in:
M66B 2019-02-02 08:43:32 +00:00
parent b19a0e0111
commit ba116353d9

View file

@ -1397,6 +1397,14 @@ public class FragmentAccount extends FragmentBase {
Long left = (account == null ? null : account.swipe_left);
Long right = (account == null ? null : account.swipe_right);
String leftDefault = EntityFolder.TRASH;
String rightDefault = EntityFolder.TRASH;
for (EntityFolder folder : folders)
if (EntityFolder.ARCHIVE.equals(folder.type)) {
rightDefault = folder.type;
break;
}
for (int pos = 0; pos < folders.size(); pos++) {
EntityFolder folder = folders.get(pos);
@ -1411,10 +1419,10 @@ public class FragmentAccount extends FragmentBase {
else if (EntityFolder.JUNK.equals(folder.type))
spJunk.setSelection(pos);
if (left == null ? (account == null && EntityFolder.TRASH.equals(folder.type)) : left.equals(folder.id))
if (left == null ? (account == null && leftDefault.equals(folder.type)) : left.equals(folder.id))
spLeft.setSelection(pos);
if (right == null ? (account == null && EntityFolder.ARCHIVE.equals(folder.type)) : right.equals(folder.id))
if (right == null ? (account == null && rightDefault.equals(folder.type)) : right.equals(folder.id))
spRight.setSelection(pos);
}