dispatchNestedScroll

open fun dispatchNestedScroll(dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, @Nullable offsetInWindow: Array<Int>, type: Int, @NonNull consumed: Array<Int>)(source)

Dispatch one step of a nested scroll in progress.

Implementations of views that support nested scrolling should call this to report info about a scroll in progress to the current nested scrolling parent. If a nested scroll is not currently in progress or nested scrolling is not enabled for this view this method does nothing.

Compatible View implementations should also call dispatchNestedPreScroll before consuming a component of the scroll event themselves.

The original nested scrolling child (where the input events were received to start the scroll) must provide a non-null consumed parameter with values {0, 0}.

Parameters

dxConsumed

Horizontal distance in pixels consumed by this view during this scroll step

dyConsumed

Vertical distance in pixels consumed by this view during this scroll step

dxUnconsumed

Horizontal scroll distance in pixels not consumed by this view

dyUnconsumed

Horizontal scroll distance in pixels not consumed by this view

offsetInWindow

Optional. If not null, on return this will contain the offset in local view coordinates of this view from before this operation to after it completes. View implementations may use this to adjust expected input coordinate tracking.

type

the type of input which cause this scroll event

consumed

Output. Upon this method returning, will contain the original values plus any scroll distances consumed by all of this view's nested scrolling parents up the view hierarchy. Index 0 for the x dimension, and index 1 for the y dimension

See also


open fun dispatchNestedScroll(dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, @Nullable offsetInWindow: Array<Int>, type: Int): Boolean(source)

Dispatch one step of a nested scroll in progress.

Implementations of views that support nested scrolling should call this to report info about a scroll in progress to the current nested scrolling parent. If a nested scroll is not currently in progress or nested scrolling is not enabled for this view this method does nothing.

Compatible View implementations should also call dispatchNestedPreScroll before consuming a component of the scroll event themselves.

Return

true if the event was dispatched, false if it could not be dispatched.

Parameters

dxConsumed

Horizontal distance in pixels consumed by this view during this scroll step

dyConsumed

Vertical distance in pixels consumed by this view during this scroll step

dxUnconsumed

Horizontal scroll distance in pixels not consumed by this view

dyUnconsumed

Horizontal scroll distance in pixels not consumed by this view

offsetInWindow

Optional. If not null, on return this will contain the offset in local view coordinates of this view from before this operation to after it completes. View implementations may use this to adjust expected input coordinate tracking.

type

the type of input which cause this scroll event

See also


open fun dispatchNestedScroll(dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, @Nullable offsetInWindow: Array<Int>): Boolean(source)