ItemTouchUIUtil

public interface ItemTouchUIUtil

androidx.recyclerview.widget.ItemTouchUIUtil


Utility class for ItemTouchHelper which handles item transformations for different API versions.

This class has methods that map to ItemTouchHelper.Callback's drawing methods. Default implementations in ItemTouchHelper.Callback call these methods with RecyclerView.ViewHolder.itemView and ItemTouchUIUtil makes necessary changes on the View depending on the API level. You can access the instance of ItemTouchUIUtil via ItemTouchHelper.Callback.getDefaultUIUtil() and call its methods with the children of ViewHolder that you want to apply default effects.

Summary

Public methods

abstract void clearView(View view)

The default implementation for ItemTouchHelper.Callback.clearView(RecyclerView, RecyclerView.ViewHolder)

abstract void onDraw(Canvas c, RecyclerView recyclerView, View view, float dX, float dY, int actionState, boolean isCurrentlyActive)

The default implementation for ItemTouchHelper.Callback.onChildDraw(Canvas, RecyclerView, RecyclerView.ViewHolder, float, float, int, boolean)

abstract void onDrawOver(Canvas c, RecyclerView recyclerView, View view, float dX, float dY, int actionState, boolean isCurrentlyActive)

The default implementation for ItemTouchHelper.Callback.onChildDrawOver(Canvas, RecyclerView, RecyclerView.ViewHolder, float, float, int, boolean)

abstract void onSelected(View view)

The default implementation for ItemTouchHelper.Callback.onSelectedChanged(RecyclerView.ViewHolder, int)

Public methods

clearView

public abstract void clearView (View view)

The default implementation for ItemTouchHelper.Callback.clearView(RecyclerView, RecyclerView.ViewHolder)

Parameters
view View

onDraw

public abstract void onDraw (Canvas c, 
                RecyclerView recyclerView, 
                View view, 
                float dX, 
                float dY, 
                int actionState, 
                boolean isCurrentlyActive)

The default implementation for ItemTouchHelpe