com.h6ah4i.android.widget.advrecyclerview.draggable.DraggableItemAdapter<T extends android.support.v7.widget.RecyclerView.ViewHolder> |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract boolean |
onCheckCanDrop(int draggingPosition, int dropPosition)
Called while dragging in order to check whether the dragging item can be dropped to the specified position.
| ||||||||||
abstract boolean |
onCheckCanStartDrag(T holder, int position, int x, int y)
Called when user is attempt to drag the item.
| ||||||||||
abstract ItemDraggableRange |
onGetItemDraggableRange(T holder, int position)
Called after the
onCheckCanStartDrag(android.support.v7.widget.RecyclerView.ViewHolder, int, int, int) method returned true. | ||||||||||
abstract void |
onMoveItem(int fromPosition, int toPosition)
Called when item is moved.
|
Called while dragging in order to check whether the dragging item can be dropped to the specified position.
NOTE: This method will be called when the checkCanDrop option is enabled by setCheckCanDropEnabled(boolean)
.
draggingPosition | The position of the currently dragging item. |
---|---|
dropPosition | The position to check whether the dragging item can be dropped or not. |
Called when user is attempt to drag the item.
holder | The ViewHolder which is associated to item user is attempt to start dragging. |
---|---|
position | The position of the item within the adapter's data set. |
x | Touched X position. Relative from the itemView's top-left. |
y | Touched Y position. Relative from the itemView's top-left. |
Called after the onCheckCanStartDrag(android.support.v7.widget.RecyclerView.ViewHolder, int, int, int)
method returned true.
holder | The ViewHolder which is associated to item user is attempt to start dragging. |
---|---|
position | The position of the item within the adapter's data set. |
Called when item is moved. Should apply the move operation result to data set.
fromPosition | Previous position of the item. |
---|---|
toPosition | New position of the item. |