onNestedFling

open fun onNestedFling(@NonNull coordinatorLayout: @NonNull CoordinatorLayout, @NonNull child: @NonNull V, @NonNull target: @NonNull View, velocityX: Float, velocityY: Float, consumed: Boolean): Boolean(source)

Called when a nested scrolling child is starting a fling or an action that would be a fling.

Any Behavior associated with the direct child of the CoordinatorLayout may elect to accept the nested scroll as part of onStartNestedScroll. Each Behavior that returned true will receive subsequent nested scroll events for that nested scroll.

onNestedFling is called when the current nested scrolling child view detects the proper conditions for a fling. It reports if the child itself consumed the fling. If it did not, the child is expected to show some sort of overscroll indication. This method should return true if it consumes the fling, so that a child that did not itself take an action in response can choose not to show an overfling indication.

Return

true if the Behavior consumed the fling

Parameters

coordinatorLayout

the CoordinatorLayout parent of the view this Behavior is associated with

child

the child view of the CoordinatorLayout this Behavior is associated with

target

the descendant view of the CoordinatorLayout performing the nested scroll

velocityX

horizontal velocity of the attempted fling

velocityY

vertical velocity of the attempted fling

consumed

true if the nested child view consumed the fling

See also