EpoxyTouchHelper

abstract class EpoxyTouchHelper

A simple way to set up drag or swipe interactions with Epoxy.

Drag events work with the EpoxyController and automatically update the controller and RecyclerView when an item is moved. You just need to implement a callback to update your data to reflect the change.

Both swipe and drag events implement a small lifecycle to help you style the views as they are moved. You can register callbacks for the lifecycle events you care about.

If you want to set up multiple drag and swipe rules for the same RecyclerView, you can use this class multiple times to specify different targets or swipe and drag directions and callbacks.

If you want more control over configuration and handling, you can opt to not use this class and instead you can implement EpoxyModelTouchCallback directly with your own . That class provides an interface that makes it easier to work with Epoxy models and simplifies touch callbacks.

If you want even more control you can implement EpoxyTouchHelperCallback. This is just a light layer over the normal RecyclerView touch callbacks, but it converts all view holders to Epoxy view holders to remove some boilerplate for you.

Types

DragBuilder
Link copied to clipboard
open class DragBuilder
DragBuilder2
Link copied to clipboard
open class DragBuilder2
DragBuilder3
Link copied to clipboard
open class DragBuilder3
DragBuilder4
Link copied to clipboard
open class DragBuilder4<U : EpoxyModel?>
DragCallbacks
Link copied to clipboard
abstract class DragCallbacks<T : EpoxyModel?> : EpoxyDragCallback<T>
SwipeBuilder
Link copied to clipboard
open class SwipeBuilder
SwipeBuilder2
Link copied to clipboard
open class SwipeBuilder2
SwipeBuilder3
Link copied to clipboard
open class SwipeBuilder3<U : EpoxyModel?>
SwipeCallbacks
Link copied to clipboard
abstract class SwipeCallbacks<T : EpoxyModel?> : EpoxySwipeCallback<T>

Functions

initDragging
Link copied to clipboard
open fun initDragging(controller: EpoxyController): EpoxyTouchHelper.DragBuilder
The entry point for setting up drag support.
initSwiping
Link copied to clipboard
open fun initSwiping(recyclerView: RecyclerView): EpoxyTouchHelper.SwipeBuilder
The entry point for setting up swipe support for a RecyclerView.