epoxy-adapter / com.airbnb.epoxy / EpoxyTouchHelper / DragBuilder4 / andCallbacks

andCallbacks

open fun andCallbacks(callbacks: EpoxyTouchHelper.DragCallbacks<U>!): ItemTouchHelper!

Set callbacks to handle drag actions and lifecycle events.

You MUST implement DragCallbacks#onModelMoved(int, int, EpoxyModel, * View) to update your data to reflect an item move.

You can optionally implement the other callbacks to modify the view being dragged. This is useful if you want to change things like the view background, size, color, etc

Return
ItemTouchHelper!: An ItemTouchHelper instance that has been initialized and attached to a recyclerview. The touch helper has already been fully set up and can be ignored, but you may want to hold a reference to it if you need to later detach the recyclerview to disable touch events via setting null on ItemTouchHelper#attachToRecyclerView(RecyclerView)