public static interface UndoHelper.OnActionListener
| Modifier and Type | Method and Description |
|---|---|
void |
onActionCanceled(int action,
java.util.List<java.lang.Integer> positions)
Called when Undo event is triggered.
|
void |
onActionConfirmed(int action,
int event)
Called when Undo timeout is over and action must be committed in the user Database.
|
void onActionCanceled(int action,
java.util.List<java.lang.Integer> positions)
Usually for a delete restoration you should call
FlexibleAdapter#restoreDeletedItems().
action - one of UndoHelper.Action.REMOVE, UndoHelper.Action.UPDATEpositions - positions affectedvoid onActionConfirmed(int action,
int event)
Due to Java Generic, it's too complicated and not well manageable if we pass the
List<T> object.
So, to get deleted items, use FlexibleAdapter#getDeletedItems() from the
implementation of this method.
action - one of UndoHelper.Action.REMOVE, UndoHelper.Action.UPDATEevent - one of Snackbar.Callback#DISMISS_EVENT_SWIPE,
Snackbar.Callback#DISMISS_EVENT_MANUAL,
Snackbar.Callback#DISMISS_EVENT_TIMEOUT,
Snackbar.Callback#DISMISS_EVENT_CONSECUTIVE