1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-03-06 11:39:49 +00:00

Move: use display name

Fixes #136
This commit is contained in:
M66B 2018-09-21 14:12:50 +00:00
parent 6f914c09b1
commit 8dff06a3ae

View file

@ -241,9 +241,9 @@ public class FragmentMessages extends FragmentEx {
args.putLong("id", message.id); args.putLong("id", message.id);
args.putInt("direction", direction); args.putInt("direction", direction);
new SimpleTask<String>() { new SimpleTask<String[]>() {
@Override @Override
protected String onLoad(Context context, Bundle args) { protected String[] onLoad(Context context, Bundle args) {
long id = args.getLong("id"); long id = args.getLong("id");
int direction = args.getInt("direction"); int direction = args.getInt("direction");
EntityFolder target = null; EntityFolder target = null;
@ -274,15 +274,15 @@ public class FragmentMessages extends FragmentEx {
Log.i(Helper.TAG, "Move id=" + id + " target=" + target); Log.i(Helper.TAG, "Move id=" + id + " target=" + target);
return target.name; return new String[]{target.name, target.display == null ? target.name : target.display};
} }
@Override @Override
protected void onLoaded(final Bundle args, final String target) { protected void onLoaded(final Bundle args, final String[] target) {
// Show undo snackbar // Show undo snackbar
final Snackbar snackbar = Snackbar.make( final Snackbar snackbar = Snackbar.make(
view, view,
getString(R.string.title_moving, Helper.localizeFolderName(getContext(), target)), getString(R.string.title_moving, Helper.localizeFolderName(getContext(), target[1])),
Snackbar.LENGTH_INDEFINITE); Snackbar.LENGTH_INDEFINITE);
snackbar.setAction(R.string.title_undo, new View.OnClickListener() { snackbar.setAction(R.string.title_undo, new View.OnClickListener() {
@Override @Override
@ -319,7 +319,7 @@ public class FragmentMessages extends FragmentEx {
snackbar.dismiss(); snackbar.dismiss();
final Context context = getContext(); final Context context = getContext();
args.putString("target", target); args.putString("target", target[0]);
// Process move in a thread // Process move in a thread
// - the fragment could be gone // - the fragment could be gone