mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-26 17:57:16 +00:00
Refectored undo
This commit is contained in:
parent
bb0c845232
commit
a0ee5fa596
1 changed files with 5 additions and 7 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue