-
public interface OnItemSwipeListenerCreated by luoxw on 2016/6/23.
-
-
Method Summary
Modifier and Type Method Description abstract voidonItemSwipeStart(RecyclerView.ViewHolder viewHolder, int pos)Called when the swipe action start. abstract voidclearView(RecyclerView.ViewHolder viewHolder, int pos)Called when the swipe action is over.If you change the view on the start, you should reset is here, no matter the item has swiped or not. abstract voidonItemSwiped(RecyclerView.ViewHolder viewHolder, int pos)Called when item is swiped, the view is going to be removed from the adapter. abstract voidonItemSwipeMoving(Canvas canvas, RecyclerView.ViewHolder viewHolder, float dX, float dY, boolean isCurrentlyActive)Draw on the empty edge when swipe moving -
-
Method Detail
-
onItemSwipeStart
abstract void onItemSwipeStart(RecyclerView.ViewHolder viewHolder, int pos)
Called when the swipe action start.
-
clearView
abstract void clearView(RecyclerView.ViewHolder viewHolder, int pos)
Called when the swipe action is over.If you change the view on the start, you should reset is here, no matter the item has swiped or not.
- Parameters:
pos- If the view is swiped, pos will be negative.
-
onItemSwiped
abstract void onItemSwiped(RecyclerView.ViewHolder viewHolder, int pos)
Called when item is swiped, the view is going to be removed from the adapter.
-
onItemSwipeMoving
abstract void onItemSwipeMoving(Canvas canvas, RecyclerView.ViewHolder viewHolder, float dX, float dY, boolean isCurrentlyActive)
Draw on the empty edge when swipe moving
- Parameters:
canvas- the empty edge's canvasviewHolder- The ViewHolder which is being interacted by the User or it wasinteracted and simply animating to its original positiondX- The amount of horizontal displacement caused by user's actiondY- The amount of vertical displacement caused by user's actionisCurrentlyActive- True if this view is currently being controlled by the user orfalse it is simply animating back to its original state.
-
-
-
-