public class SwipeUndoTouchListener extends SwipeDismissTouchListener
SwipeDismissTouchListener that adds an undo stage to the item swiping.| Constructor and Description |
|---|
SwipeUndoTouchListener(com.nhaarman.listviewanimations.util.ListViewWrapper listViewWrapper,
UndoCallback callback) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterCancelSwipe(View view,
int position)
Called after the restore animation of a canceled swipe movement ends.
|
protected void |
afterViewFling(View view,
int position)
Called after the fling animation of a succesful swipe ends.
|
void |
dimissPending()
Dismisses all items that are in the undo state.
|
protected void |
directDismiss(int position) |
protected void |
finalizeDismiss()
If necessary, notifies the
UndoCallback to remove dismissed object from the adapter,
and restores the View presentations. |
boolean |
hasPendingItems() |
protected void |
performDismiss(View view,
int position)
Animates the dismissed list item to zero-height and fires the dismiss callback when all dismissed list item animations have completed.
|
protected void |
restoreViewPresentation(View view)
Restores the height of given
View. |
void |
undo(View view)
Performs the undo animation and restores the original state for given
View. |
protected boolean |
willLeaveDataSetOnFling(View view,
int position)
Returns whether flinging the item at given position in the current state
would cause it to be removed from the data set.
|
dismiss, fling, getActiveDismissCount, getDismissAnimationTime, notifyCallback, restoreViewPresentationsbeforeViewFling, disableSwipe, enableSwipe, getActiveSwipeCount, getListViewWrapper, getSwipeView, isInteracting, isSwiping, notifyDataSetChanged, onCancelSwipe, onStartSwipe, onTouch, onTouchEvent, setDismissableManager, setMinimumAlpha, setParentIsHorizontalScrollContainer, setTouchChildpublic SwipeUndoTouchListener(com.nhaarman.listviewanimations.util.ListViewWrapper listViewWrapper,
UndoCallback callback)
protected boolean willLeaveDataSetOnFling(View view, int position)
SwipeTouchListenerwillLeaveDataSetOnFling in class SwipeDismissTouchListenerview - the View that would be flinged.position - the position of the item in the ListAdapter corresponding to the View.true if the item would leave the data set, false otherwise.protected void afterViewFling(View view, int position)
SwipeTouchListenerafterViewFling in class SwipeDismissTouchListenerview - the View that is being swiped.position - the position of the item in the ListAdapter corresponding to the View.protected void afterCancelSwipe(View view, int position)
SwipeTouchListenerafterCancelSwipe in class SwipeDismissTouchListenerview - the View that is being swiped.position - the position of the item in the ListAdapter corresponding to the View.protected void performDismiss(View view, int position)
performDismiss in class SwipeDismissTouchListenerview - the dismissed View.public boolean hasPendingItems()
public void dimissPending()
protected void finalizeDismiss()
UndoCallback to remove dismissed object from the adapter,
and restores the View presentations.finalizeDismiss in class SwipeDismissTouchListenerprotected void restoreViewPresentation(View view)
View.
Also calls its super implementation.restoreViewPresentation in class SwipeDismissTouchListenerview - the View whose presentation should be restored.public void undo(View view)
View.view - the parent View which contains both primary and undo Views.protected void directDismiss(int position)
directDismiss in class SwipeDismissTouchListener