Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
added in version 24.1.0
belongs to Maven artifact com.android.support:recyclerview-v7:28.0.0-alpha1

ItemTouchUIUtil

public interface ItemTouchUIUtil

android.support.v7.widget.helper.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 itemView and ItemTouchUIUtil makes necessary changes on the View depending on the API level. You can access the instance of ItemTouchUIUtil via getDefaultUIUtil() and call its methods with the children of ViewHolder that you want to apply default effects.

See also:

Summary

Public methods

abstract void clearView(View view)

The default implementation for 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 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 onChildDrawOver(Canvas, RecyclerView, RecyclerView.ViewHolder, float, float, int, boolean)

abstract void onSelected(View view)

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

Public methods

clearView

added in version 24.1.0
void clearView (View view)

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

Parameters
view View

onDraw

added in version 24.1.0
void onDraw (Canvas c, 
                RecyclerView recyclerView, 
                View view, 
                float dX, 
                float dY, 
                int actionState, 
                boolean isCurrentlyActive)

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

Parameters
c Canvas

recyclerView RecyclerView

view View

dX float

dY float

actionState int

isCurrentlyActive boolean

onDrawOver

added in version 24.1.0
void onDrawOver (Canvas c, 
                RecyclerView recyclerView, 
                View view, 
                float dX, 
                float dY, 
                int actionState, 
                boolean isCurrentlyActive)

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

Parameters
c Canvas

recyclerView RecyclerView

view View

dX float

dY float

actionState int

isCurrentlyActive boolean

onSelected

added in version 24.1.0
void onSelected (View view)

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

Parameters
view View