onNestedScroll

open fun onNestedScroll(coordinatorLayout: CoordinatorLayout, child: View, target: View, dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, type: Int, consumed: Array<Int>)(source)

Called when a nested scroll in progress has updated and the target has scrolled or attempted to scroll.

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.

onNestedScroll is called each time the nested scroll is updated by the nested scrolling child, with both consumed and unconsumed components of the scroll supplied in pixels. Each Behavior responding to the nested scroll will receive the same values.

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

dxConsumed

horizontal pixels consumed by the target's own scrolling operation

dyConsumed

vertical pixels consumed by the target's own scrolling operation

dxUnconsumed

horizontal pixels not consumed by the target's own scrolling operation, but requested by the user

dyUnconsumed

vertical pixels not consumed by the target's own scrolling operation, but requested by the user

type

the type of input which cause this scroll event

consumed

output. Upon this method returning, should contain the scroll distances consumed by this Behavior

See also