epoxy-adapter / com.airbnb.epoxy / EpoxySwipeCallback

EpoxySwipeCallback

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

For use with EpoxyModelTouchCallback

Functions

onSwipeCompleted

abstract fun onSwipeCompleted(model: T, itemView: View!, position: Int, direction: Int): Unit

Called after #onSwipeReleased(EpoxyModel, View) if the swipe surpassed the threshold to be considered a full swipe. The view will now be animated off screen.

onSwipeProgressChanged

abstract fun onSwipeProgressChanged(model: T, itemView: View!, swipeProgress: Float, canvas: Canvas!): Unit

Once a view has begun swiping with #onSwipeStarted(EpoxyModel, View, int) it will receive this callback as the swipe distance changes. This can be called multiple times as the swipe interaction progresses.

onSwipeReleased

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

Called when the user has released their touch on the view. If the displacement passed the swipe threshold then #onSwipeCompleted(EpoxyModel, View, int, int) will be called after this and the view will be animated off screen. Otherwise the view will animate back to its original position.

onSwipeStarted

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

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

Inheritors

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.

SwipeCallbacks

abstract class SwipeCallbacks<T : EpoxyModel<Any!>!> : EpoxySwipeCallback<T>