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

Refectored undo

This commit is contained in:
M66B 2020-12-15 07:59:36 +01:00
parent bb0c845232
commit a0ee5fa596

View file

@ -767,6 +767,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
Log.i("Undo cancel");
snackbar.getView().setTag(true);
snackbar.dismiss();
show.execute(ActivityView.this, args, "undo:show");
}
});
@ -783,16 +784,12 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
@Override
public void onDismissed(Snackbar transientBottomBar, int event) {
if (snackbar.getView().getTag() == null)
move.execute(ActivityView.this, args, "undo:move");
else
show.execute(ActivityView.this, args, "undo:show");
ViewGroup.MarginLayoutParams lparam = (ViewGroup.MarginLayoutParams) content.getLayoutParams();
lparam.bottomMargin = margin;
content.setLayoutParams(lparam);
}
});
snackbar.show();
// Wait
@ -800,8 +797,9 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
@Override
public void run() {
Log.i("Undo timeout");
if (snackbar.isShown())
snackbar.dismiss();
snackbar.dismiss();
if (snackbar.getView().getTag() == null)
move.execute(ActivityView.this, args, "undo:move");
}
}, undo_timeout);
}