epoxy-adapter / com.airbnb.epoxy / EpoxyDragCallback

EpoxyDragCallback

interface EpoxyDragCallback<T : EpoxyModel<Any!>!> : BaseEpoxyTouchCallback<T>

For use with EpoxyModelTouchCallback

Functions

onDragReleased

abstract fun onDragReleased(model: T, itemView: View!): Unit

Called after #onDragStarted(EpoxyModel, View, int) when the view being dragged is released. If the view was dragged to a new, valid location then #onModelMoved(int, int, * EpoxyModel, View) will be called before this and the view will settle to the new location. Otherwise the view will animate back to its original position.

onDragStarted

abstract fun onDragStarted(model: T, itemView: View!, adapterPosition: Int): Unit

Called when the view switches from an idle state to a dragged state, as the user begins a drag interaction with it. You can use this callback to modify the view to indicate it is being dragged.

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.

Inheritors

DragCallbacks

abstract class DragCallbacks<T : EpoxyModel<Any!>!> : EpoxyDragCallback<T>

EpoxyModelTouchCallback

abstract class EpoxyModelTouchCallback<T : EpoxyModel<Any!>!> : EpoxyTouchHelperCallback, EpoxyDragCallback<T>, EpoxySwipeCallback<T>

A wrapper around androidx.recyclerview.widget.ItemTouchHelper.Callback to enable easier touch support when working with Epoxy models.