epoxy-adapter / com.airbnb.epoxy / EpoxyDragCallback / onModelMoved

onModelMoved

abstract fun onModelMoved(fromPosition: Int, toPosition: Int, modelBeingMoved: T, itemView: View!): Unit

Called after #onDragStarted(EpoxyModel, View, int) when the dragged view is dropped to a new position. The EpoxyController will be updated automatically for you to reposition the models and notify the RecyclerView of the change.

You MUST use this callback to modify your data backing the models to reflect the change.

The next callback in the drag lifecycle will be #onDragStarted(EpoxyModel, View, int)

Parameters

modelBeingMoved - T: The model representing the view that was moved

itemView - View!: The view that was moved

fromPosition - Int: The adapter position that the model came from

toPosition - Int: The new adapter position of the model