onChildDrawOver
Called by ItemTouchHelper on RecyclerView's onDraw callback.
If you would like to customize how your View's respond to user interactions, this is a good place to override.
Default implementation translates the child by the given dX
, dY
. ItemTouchHelper also takes care of drawing the child after other children if it is being dragged. This is done using child re-ordering mechanism. On platforms prior to L, this is achieved via getChildDrawingOrder and on L and after, it changes View's elevation value to be greater than all other children.)
Parameters
The canvas which RecyclerView is drawing its children
The RecyclerView to which ItemTouchHelper is attached to
The ViewHolder which is being interacted by the User or it was interacted and simply animating to its original position
The amount of horizontal displacement caused by user's action
The amount of vertical displacement caused by user's action
The type of interaction on the View. Is either ACTION_STATE_DRAG or ACTION_STATE_SWIPE.
True if this view is currently being controlled by the user or false it is simply animating back to its original state.