-
public abstract class EpoxyTouchHelperA 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classEpoxyTouchHelper.DragBuilderpublic classEpoxyTouchHelper.DragBuilder2public classEpoxyTouchHelper.DragBuilder3public classEpoxyTouchHelper.DragBuilder4public abstract classEpoxyTouchHelper.DragCallbackspublic classEpoxyTouchHelper.SwipeBuilderpublic classEpoxyTouchHelper.SwipeBuilder2public classEpoxyTouchHelper.SwipeBuilder3public abstract classEpoxyTouchHelper.SwipeCallbacks
-
Method Summary
Modifier and Type Method Description static EpoxyTouchHelper.DragBuilderinitDragging(EpoxyController controller)The entry point for setting up drag support. static EpoxyTouchHelper.SwipeBuilderinitSwiping(RecyclerView recyclerView)The entry point for setting up swipe support for a RecyclerView. -
-
Method Detail
-
initDragging
static EpoxyTouchHelper.DragBuilder initDragging(EpoxyController controller)
The entry point for setting up drag support.
- Parameters:
controller- The EpoxyController with the models that will be dragged.
-
initSwiping
static EpoxyTouchHelper.SwipeBuilder initSwiping(RecyclerView recyclerView)
The entry point for setting up swipe support for a RecyclerView. The RecyclerView must be setwith an Epoxy adapter or controller.
-
-
-
-