NestedScrollingChild3
public interface NestedScrollingChild3 extends NestedScrollingChild2
NestedScrollView |
NestedScrollView is just like |
RecyclerView |
A flexible view for providing a limited window into a large data set. |
SwipeRefreshLayout |
The SwipeRefreshLayout should be used whenever the user can refresh the contents of a view via a vertical swipe gesture. |
BaseGridView |
An abstract base class for vertically and horizontally scrolling lists. |
HorizontalGridView |
A |
VerticalGridView |
A |
WearableRecyclerView |
Wearable specific implementation of the |
This interface should be implemented by View subclasses that wish to support dispatching nested scrolling operations to a cooperating parent ViewGroup.
Classes implementing this interface should create a final instance of a NestedScrollingChildHelper as a field and delegate any View methods to the NestedScrollingChildHelper methods of the same signature.
Views invoking nested scrolling functionality should always do so from the relevant ViewCompat, ViewGroupCompat or ViewParentCompat compatibility shim static methods. This ensures interoperability with nested scrolling views on all versions of Android.
Summary
Public methods |
|
|---|---|
abstract void |
dispatchNestedScroll(Dispatch one step of a nested scroll in progress. |
Inherited methods |
||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||
|
Public methods
dispatchNestedScroll
abstract void dispatchNestedScroll(
int dxConsumed,
int dyConsumed,
int dxUnconsumed,
int dyUnconsumed,
@Nullable int[] offsetInWindow,
int type,
@NonNull int[] consumed
)
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 | |
|---|---|
int dxConsumed |
Horizontal distance in pixels consumed by this view during this scroll step |
int dyConsumed |
Vertical distance in pixels consumed by this view during this scroll step |
int dxUnconsumed |
Horizontal scroll distance in pixels not consumed by this view |
int dyUnconsumed |
Horizontal scroll distance in pixels not consumed by this view |
@Nullable int[] 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. |
int type |
the type of input which cause this scroll event |
@NonNull int[] 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 | |
|---|---|
onNestedScroll |