onMove

abstract fun onMove(@NonNull recyclerView: RecyclerView, @NonNull viewHolder: RecyclerView.ViewHolder, @NonNull target: RecyclerView.ViewHolder): Boolean(source)

Called when ItemTouchHelper wants to move the dragged item from its old position to the new position.

If this method returns true, ItemTouchHelper assumes viewHolder has been moved to the adapter position of target ViewHolder (ViewHolder#getAdapterPositionInRecyclerView()).

If you don't support drag &drop, this method will never be called.

Return

True if the viewHolder has been moved to the adapter position of target.

Parameters

recyclerView

The RecyclerView to which ItemTouchHelper is attached to.

viewHolder

The ViewHolder which is being dragged by the user.

target

The ViewHolder over which the currently active item is being dragged.

See also