-
- All Implemented Interfaces:
-
eu.davidea.flexibleadapter.FlexibleAdapter.OnActionStateListener
public interface FlexibleAdapter.OnItemMoveListener implements FlexibleAdapter.OnActionStateListener
-
-
Method Summary
Modifier and Type Method Description abstract booleanshouldMoveItem(int fromPosition, int toPosition)Called when the item would like to be swapped. abstract voidonItemMove(int fromPosition, int toPosition)Called when an item has been dragged far enough to trigger a move. -
-
Method Detail
-
shouldMoveItem
abstract boolean shouldMoveItem(int fromPosition, int toPosition)
Called when the item would like to be swapped.
Delegate this permission to the user.
- Parameters:
fromPosition- the potential start position of the dragged itemtoPosition- the potential resolved position of the swapped item
-
onItemMove
abstract void 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.
The end of the "drop" event is instead handled by onItemReleased.
Tip: Here, you should call invalidateItemDecorations to recalculateitem offset if any item decoration has been set.- Parameters:
fromPosition- the start position of the moved itemtoPosition- the resolved position of the moved item
-
-
-
-