features/characters_favorites / com.vmadalin.dynamicfeatures.charactersfavorites.ui.favorite.adapter / CharactersFavoriteTouchHelper

CharactersFavoriteTouchHelper

class CharactersFavoriteTouchHelper : SimpleCallback

Helper class customize touch behavior per RecyclerView.ViewHolder allowing to swipe.

See Also

ItemTouchHelper.SimpleCallback

Constructors

<init>

Helper class customize touch behavior per RecyclerView.ViewHolder allowing to swipe.

CharactersFavoriteTouchHelper(onSwiped: (Int) -> Unit)

Functions

onMove

Called when ItemTouchHelper wants to move the dragged item from its old position to the new position.

fun onMove(recyclerView: RecyclerView, viewHolder: ViewHolder, target: ViewHolder): Boolean

onSwiped

Called when a ViewHolder is swiped by the user.

fun onSwiped(viewHolder: ViewHolder, direction: Int): Unit