Undo on move selection only

This commit is contained in:
M66B 2019-11-07 10:33:58 +01:00
parent 929d593ee4
commit 7b7942f56c
1 changed files with 10 additions and 7 deletions

View File

@ -706,7 +706,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
@Override @Override
protected void onExecuted(Bundle args, ArrayList<MessageTarget> result) { protected void onExecuted(Bundle args, ArrayList<MessageTarget> result) {
moveAsk(result); moveAsk(result, false);
} }
@Override @Override
@ -1336,7 +1336,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
@Override @Override
protected void onExecuted(Bundle args, ArrayList<MessageTarget> result) { protected void onExecuted(Bundle args, ArrayList<MessageTarget> result) {
moveAsk(result); moveAsk(result, false);
} }
@Override @Override
@ -2229,7 +2229,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
if (EntityFolder.JUNK.equals(type)) if (EntityFolder.JUNK.equals(type))
moveAskConfirmed(result); moveAskConfirmed(result);
else else
moveAsk(result); moveAsk(result, true);
} }
@Override @Override
@ -2293,7 +2293,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
@Override @Override
protected void onExecuted(Bundle args, ArrayList<MessageTarget> result) { protected void onExecuted(Bundle args, ArrayList<MessageTarget> result) {
moveAsk(result); moveAsk(result, true);
} }
@Override @Override
@ -3484,13 +3484,16 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
}.execute(this, args, "messages:navigate"); }.execute(this, args, "messages:navigate");
} }
private void moveAsk(final ArrayList<MessageTarget> result) { private void moveAsk(final ArrayList<MessageTarget> result, boolean undo) {
if (result.size() == 0) if (result.size() == 0)
return; return;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
if (prefs.getBoolean("automove", false)) { if (prefs.getBoolean("automove", false)) {
moveUndo(result); if (undo)
moveUndo(result);
else
moveAskConfirmed(result);
return; return;
} }
@ -4489,7 +4492,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
@Override @Override
protected void onExecuted(Bundle args, ArrayList<MessageTarget> result) { protected void onExecuted(Bundle args, ArrayList<MessageTarget> result) {
moveAsk(result); moveAsk(result, false);
} }
@Override @Override