public static interface RecyclerViewItemHelper.InteractiveViewHolder
ViewHolders with which may user interact
via a concrete RecyclerViewItemHelper implementation.| Modifier and Type | Method and Description |
|---|---|
View |
getInteractiveView(int interaction)
Returns the view that a user may interact with for the specified interaction.
|
void |
onDraw(Canvas canvas,
float dX,
float dY,
int interaction,
boolean isCurrentlyActive)
Called by the item helper to allow this holder to draw its current state in order to
respond to user interactions.
|
void |
onDrawOver(Canvas canvas,
float dX,
float dY,
int interaction,
boolean isCurrentlyActive)
Called by the item helper to allow this holder to draw its current state in order to
respond to user interactions.
|
@Nullable View getInteractiveView(int interaction)
Note that the interactive view must be either the item view of this holder or one of the item view's descendants.
interaction - The type of interaction for which to return the View. Either
ItemTouchHelper.ACTION_STATE_SWIPE or ItemTouchHelper.ACTION_STATE_DRAG.null if this holder does not have any
special view for the specified interaction so its item view should be considered as
interactive view.void onDraw(@NonNull Canvas canvas, float dX, float dY, int interaction, boolean isCurrentlyActive)
canvas - The canvas on which to draw.dX - The amount of horizontal displacement caused by user's interaction.dY - The amount of vertical displacement caused by user's interaction.interaction - The type of interaction on the holder's View.
Either ItemTouchHelper.ACTION_STATE_SWIPE or ItemTouchHelper.ACTION_STATE_DRAG.isCurrentlyActive - True if view of this holder is currently being controlled
by the user, false if it is simply animating back to its
original state.ItemTouchHelper.Callback#onChildDraw(Canvas, RecyclerView, RecyclerView.ViewHolder, float, float, int, boolean)void onDrawOver(@NonNull Canvas canvas, float dX, float dY, int interaction, boolean isCurrentlyActive)
canvas - The canvas on which to draw.dX - The amount of horizontal displacement caused by user's interaction.dY - The amount of vertical displacement caused by user's interaction.interaction - The type of interaction on the holder's View.
Either ItemTouchHelper.ACTION_STATE_SWIPE or ItemTouchHelper.ACTION_STATE_DRAG.isCurrentlyActive - True if view of this holder is currently being controlled
by the user, false if it is simply animating back to its
original state.ItemTouchHelper.Callback#onChildDrawOver(Canvas, RecyclerView, RecyclerView.ViewHolder, float, float, int, boolean)