RecyclerView.OnFlingListener


abstract class RecyclerView.OnFlingListener

Known direct subclasses
SnapHelper

Class intended to support snapping for a RecyclerView.

Known indirect subclasses
LinearSnapHelper

Implementation of the SnapHelper supporting snapping in either vertical or horizontal orientation.

PagerSnapHelper

Implementation of the SnapHelper supporting pager style snapping in either vertical or horizontal orientation.


This class defines the behavior of fling if the developer wishes to handle it.

Subclasses of OnFlingListener can be used to implement custom fling behavior.

Summary

Public constructors

Public functions

abstract Boolean
onFling(velocityX: Int, velocityY: Int)

Override this to handle a fling given the velocities in both x and y directions.

Public constructors

OnFlingListener

Added in 1.0.0
OnFlingListener()

Public functions

onFling

Added in 1.0.0
abstract fun onFling(velocityX: Int, velocityY: Int): Boolean

Override this to handle a fling given the velocities in both x and y directions. Note that this method will only be called if the associated LayoutManager supports scrolling and the fling is not handled by nested scrolls first.

Parameters
velocityX: Int

the fling velocity on the X axis

velocityY: Int

the fling velocity on the Y axis

Returns
Boolean

true if the fling was handled, false otherwise.