1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-25 17:27:00 +00:00

Refactoring

This commit is contained in:
M66B 2022-04-16 20:39:46 +02:00
parent 67d5cb97e3
commit 74fa856ff0

View file

@ -6527,7 +6527,18 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
return;
}
SimpleTask<Void> move = new SimpleTask<Void>() {
String title = getString(R.string.title_move_undo, getNames(result, true), result.size());
((ActivityView) activity).undo(title, args, taskUndoMove, taskUndoShow);
}
@Override
protected void onException(Bundle args, Throwable ex) {
Log.unexpectedError(getParentFragmentManager(), ex);
}
}.execute(this, args, "undo:hide");
}
private static final SimpleTask<Void> taskUndoMove = new SimpleTask<Void>() {
@Override
protected Void onExecute(Context context, Bundle args) {
ArrayList<MessageTarget> result = args.getParcelableArrayList("result");
@ -6563,7 +6574,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
}
};
SimpleTask<Void> show = new SimpleTask<Void>() {
private static final SimpleTask<Void> taskUndoShow = new SimpleTask<Void>() {
@Override
protected Void onExecute(Context context, Bundle args) {
ArrayList<MessageTarget> result = args.getParcelableArrayList("result");
@ -6594,17 +6605,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
}
};
String title = getString(R.string.title_move_undo, getNames(result, true), result.size());
((ActivityView) activity).undo(title, args, move, show);
}
@Override
protected void onException(Bundle args, Throwable ex) {
Log.unexpectedError(getParentFragmentManager(), ex);
}
}.execute(this, args, "undo:hide");
}
private static String getNames(ArrayList<MessageTarget> result, boolean dest) {
boolean across = false;
for (MessageTarget target : result)