onNestedPreFling

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

Called when a nested scrolling child is about to start 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.

onNestedPreFling is called when the current nested scrolling child view detects the proper conditions for a fling, but it has not acted on it yet. A Behavior can return true to indicate that it consumed the fling. If at least one Behavior returns true, the fling should not be acted upon by the child.

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

See also