Package 

Interface ItemTouchHelperCallback.AdapterCallback

    • Method Summary

      Modifier and Type Method Description
      abstract void onActionStateChanged(RecyclerView.ViewHolder viewHolder, int actionState) Called when the ItemTouchHelper first registers an item as being moved or swipedor when has been released.
      abstract boolean shouldMove(int fromPosition, int toPosition) Evaluate if positions are compatible for swapping.
      abstract boolean onItemMove(int fromPosition, int toPosition) Called when an item has been dragged far enough to trigger a move.
      abstract void onItemSwiped(int position, int direction) Called when an item has been dismissed by a swipe.
      • Methods inherited from class java.lang.Object

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

      • shouldMove

         abstract boolean shouldMove(int fromPosition, int toPosition)

        Evaluate if positions are compatible for swapping.

        Parameters:
        fromPosition - the start position of the moving item
        toPosition - the potential target position of the moving item
      • onItemMove

         abstract boolean onItemMove(int fromPosition, int toPosition)

        Called when an item has been dragged far enough to trigger a move. This is calledevery time an item is shifted, and not at the end of a "drop" event.

        Implementations should call notifyItemMoved after adjusting the underlying data to reflect this move.

        Parameters:
        fromPosition - the start position of the moved item
        toPosition - the resolved position of the moved item
      • onItemSwiped

         abstract void onItemSwiped(int position, int direction)

        Called when an item has been dismissed by a swipe.

        Implementations should decide to call or not notifyItemRemoved after adjusting the underlying data to reflect this removal.

        Parameters:
        position - the position of the item dismissed
        direction - the direction to which the ViewHolder is swiped