Package 

Interface OnItemSwipeListener

    • Method Summary

      Modifier and Type Method Description
      abstract void onItemSwipeStart(RecyclerView.ViewHolder viewHolder, int pos) Called when the swipe action start.
      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.
      abstract void onItemSwiped(RecyclerView.ViewHolder viewHolder, int pos) Called when item is swiped, the view is going to be removed from the adapter.
      abstract void onItemSwipeMoving(Canvas canvas, RecyclerView.ViewHolder viewHolder, float dX, float dY, boolean isCurrentlyActive) Draw on the empty edge when swipe moving
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • 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.
      • 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 canvas
        viewHolder - The ViewHolder which is being interacted by the User or it wasinteracted and simply animating to its original position
        dX - The amount of horizontal displacement caused by user's action
        dY - The amount of vertical displacement caused by user's action
        isCurrentlyActive - True if this view is currently being controlled by the user orfalse it is simply animating back to its original state.