getSwipeEscapeVelocity

open fun getSwipeEscapeVelocity(defaultValue: Float): Float(source)

Defines the minimum velocity which will be considered as a swipe action by the user.

You can increase this value to make it harder to swipe or decrease it to make it easier. Keep in mind that ItemTouchHelper also checks the perpendicular velocity and makes sure current direction velocity is larger then the perpendicular one. Otherwise, user's movement is ambiguous. You can change the threshold by overriding getSwipeVelocityThreshold.

The velocity is calculated in pixels per second.

The default framework value is passed as a parameter so that you can modify it with a multiplier.

Return

The minimum swipe velocity. The default implementation returns the defaultValue parameter.

Parameters

defaultValue

The default value (in pixels per second) used by the ItemTouchHelper.

See also