getAnimationDuration

open fun getAnimationDuration(@NonNull recyclerView: RecyclerView, animationType: Int, animateDx: Float, animateDy: Float): Long(source)

Called by the ItemTouchHelper when user action finished on a ViewHolder and now the View will be animated to its final position.

Default implementation uses ItemAnimator's duration values. If animationType is ANIMATION_TYPE_DRAG, it returns getMoveDuration, otherwise, it returns getRemoveDuration. If RecyclerView does not have any RecyclerView.ItemAnimator attached, this method returns DEFAULT_DRAG_ANIMATION_DURATION or DEFAULT_SWIPE_ANIMATION_DURATION depending on the animation type.

Return

The duration for the animation

Parameters

recyclerView

The RecyclerView to which the ItemTouchHelper is attached to.

animationType
animateDx

The horizontal distance that the animation will offset

animateDy

The vertical distance that the animation will offset