public static interface ItemDragHelper.DragAdapter
ViewHolders.| Modifier and Type | Method and Description |
|---|---|
boolean |
canDropItemOver(int currentPosition,
int targetPosition)
Called by the drag helper to check if item associated with the currentPosition
can be dropped at the specified targetPosition.
|
int |
getItemDragFlags(int position)
Called by the drag helper to obtain drag movement flags for an item at the specified
position.
|
void |
onItemDragFinished(int fromPosition,
int toPosition)
Called by the drag helper whenever drag gesture for item associated with the specified
fromPosition has finished.
|
void |
onItemDragStarted(int position)
Called by the drag helper whenever drag gesture for item associated with the specified
position has started.
|
boolean |
onMoveItem(int currentPosition,
int targetPosition)
Called by the drag helper to inform this adapter that it should move its item in its
data set from the specified currentPosition to the specified targetPosition.
|
int getItemDragFlags(int position)
position - Position of the item for which to obtain its drag flags.ItemDragHelper.makeDragFlags(int)void onItemDragStarted(int position)
position - Position of the view holder of which view started to be dragged by the user.onItemDragFinished(int, int),
onMoveItem(int, int)boolean onMoveItem(int currentPosition,
int targetPosition)
currentPosition - The position from which should be the item moved in this adapter's
data set.targetPosition - The position to which should be the item moved in this adapter's
data set.True if item has been moved form the current position to the target one,
false otherwise.boolean canDropItemOver(int currentPosition,
int targetPosition)
If this method returns true, this adapter receives onItemDragFinished(int, int)
callback in a near feature.
currentPosition - Current position of the associated view holder.targetPosition - Target position at which could be the associated view holder dropped.True if the holder can be dropped at the target position, false
otherwise.onItemDragFinished(int, int)void onItemDragFinished(int fromPosition,
int toPosition)
fromPosition - The position from which has been the associated view holder started
to be dragged.toPosition - The position at which has been the associated view holder dropped.canDropItemOver(int, int),
onItemDragStarted(int)