SwipeListener

interface SwipeListener

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun onRestoreSwipePosition(viewHolder: SwipeViewHolder, adapterPosition: Int)

Invoked in order to set the viewHolder's initial state when bound. This supports view holder reuse. When items are scrolled off-screen and the view holder is reused, it becomes important to track the swiped state and determine if the view holder should appear as swiped for the item being bound.

Link copied to clipboard
abstract fun onSwipeCanceled(viewHolder: SwipeViewHolder, adapterPosition: Int, x: Float? = null, y: Float? = null)

Invoked when a swipe is canceled.

Link copied to clipboard
abstract fun onSwipeChanged(viewHolder: SwipeViewHolder, adapterPosition: Int, dX: Float, totalDeltaX: Float)

Invoked after a swipe has been detected, and movement is occurring.

Link copied to clipboard
abstract fun onSwipeCompleted(viewHolder: SwipeViewHolder, adapterPosition: Int, x: Float? = null, y: Float? = null)

Invoked when a swipe is successfully completed naturally, without cancellation.

Link copied to clipboard
abstract fun onSwipeStarted(viewHolder: SwipeViewHolder, adapterPosition: Int, x: Float? = null, y: Float? = null)

Invoked when a swipe is detected.