mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-31 11:31:40 +00:00
Use trash if no archive for right swipe target
This commit is contained in:
parent
b19a0e0111
commit
ba116353d9
1 changed files with 10 additions and 2 deletions
|
@ -1397,6 +1397,14 @@ public class FragmentAccount extends FragmentBase {
|
||||||
Long left = (account == null ? null : account.swipe_left);
|
Long left = (account == null ? null : account.swipe_left);
|
||||||
Long right = (account == null ? null : account.swipe_right);
|
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++) {
|
for (int pos = 0; pos < folders.size(); pos++) {
|
||||||
EntityFolder folder = folders.get(pos);
|
EntityFolder folder = folders.get(pos);
|
||||||
|
|
||||||
|
@ -1411,10 +1419,10 @@ public class FragmentAccount extends FragmentBase {
|
||||||
else if (EntityFolder.JUNK.equals(folder.type))
|
else if (EntityFolder.JUNK.equals(folder.type))
|
||||||
spJunk.setSelection(pos);
|
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);
|
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);
|
spRight.setSelection(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue