From 7b7942f56c24d65851d37cfcb04ee9ecd4be2904 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 7 Nov 2019 10:33:58 +0100 Subject: [PATCH] Undo on move selection only --- .../eu/faircode/email/FragmentMessages.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 982c10cb27..58c24696bb 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -706,7 +706,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. @Override protected void onExecuted(Bundle args, ArrayList result) { - moveAsk(result); + moveAsk(result, false); } @Override @@ -1336,7 +1336,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. @Override protected void onExecuted(Bundle args, ArrayList result) { - moveAsk(result); + moveAsk(result, false); } @Override @@ -2229,7 +2229,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. if (EntityFolder.JUNK.equals(type)) moveAskConfirmed(result); else - moveAsk(result); + moveAsk(result, true); } @Override @@ -2293,7 +2293,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. @Override protected void onExecuted(Bundle args, ArrayList result) { - moveAsk(result); + moveAsk(result, true); } @Override @@ -3484,13 +3484,16 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. }.execute(this, args, "messages:navigate"); } - private void moveAsk(final ArrayList result) { + private void moveAsk(final ArrayList result, boolean undo) { if (result.size() == 0) return; SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); if (prefs.getBoolean("automove", false)) { - moveUndo(result); + if (undo) + moveUndo(result); + else + moveAskConfirmed(result); return; } @@ -4489,7 +4492,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. @Override protected void onExecuted(Bundle args, ArrayList result) { - moveAsk(result); + moveAsk(result, false); } @Override