public class SwipeDismissTouchListener extends SwipeTouchListener
SwipeTouchListener that directly dismisses the items when swiped.| Constructor and Description |
|---|
SwipeDismissTouchListener(com.nhaarman.listviewanimations.util.ListViewWrapper listViewWrapper,
OnDismissCallback callback)
Constructs a new
SwipeDismissTouchListener for the given AbsListView. |
| 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.
|
protected void |
directDismiss(int position) |
void |
dismiss(int position)
Dismisses the
View corresponding to given position. |
protected void |
finalizeDismiss()
If necessary, notifies the
OnDismissCallback to remove dismissed object from the adapter,
and restores the View presentations. |
void |
fling(int position)
Flings the
View corresponding to given position out of sight. |
protected int |
getActiveDismissCount() |
long |
getDismissAnimationTime() |
protected void |
notifyCallback(List<Integer> dismissedPositions)
Notifies the
OnDismissCallback of dismissed items. |
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)
|
protected void |
restoreViewPresentations(Iterable<View> views)
Restores the presentation of given
Views by calling restoreViewPresentation(android.view.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.
|
beforeViewFling, disableSwipe, enableSwipe, getActiveSwipeCount, getListViewWrapper, getSwipeView, isInteracting, isSwiping, notifyDataSetChanged, onCancelSwipe, onStartSwipe, onTouch, onTouchEvent, setDismissableManager, setMinimumAlpha, setParentIsHorizontalScrollContainer, setTouchChildpublic SwipeDismissTouchListener(com.nhaarman.listviewanimations.util.ListViewWrapper listViewWrapper,
OnDismissCallback callback)
SwipeDismissTouchListener for the given AbsListView.listViewWrapper - The ListViewWrapper containing the ListView whose items should be dismissable.callback - The callback to trigger when the user has indicated that hepublic void dismiss(int position)
View corresponding to given position.
Calling this method has the same effect as manually swiping an item off the screen.position - the position of the item in the ListAdapter. Must be visible.public void fling(int position)
SwipeTouchListenerView corresponding to given position out of sight.
Calling this method has the same effect as manually swiping an item off the screen.fling in class SwipeTouchListenerposition - the position of the item in the ListAdapter. Must be visible.protected void directDismiss(int position)
protected void afterCancelSwipe(View view, int position)
SwipeTouchListenerafterCancelSwipe in class SwipeTouchListenerview - the View that is being swiped.position - the position of the item in the ListAdapter corresponding to the View.protected boolean willLeaveDataSetOnFling(View view, int position)
SwipeTouchListenerwillLeaveDataSetOnFling in class SwipeTouchListenerview - 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 SwipeTouchListenerview - 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)
view - the dismissed View.protected void finalizeDismiss()
OnDismissCallback to remove dismissed object from the adapter,
and restores the View presentations.protected void notifyCallback(List<Integer> dismissedPositions)
OnDismissCallback of dismissed items.dismissedPositions - the positions that have been dismissed.protected void restoreViewPresentations(Iterable<View> views)
Views by calling restoreViewPresentation(android.view.View).protected void restoreViewPresentation(View view)
SwipeTouchListenerView's alpha and translationX values.
Users of this class should call this method when recycling Views.restoreViewPresentation in class SwipeTouchListenerview - the View whose presentation should be restored.protected int getActiveDismissCount()
public long getDismissAnimationTime()