belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1
NestedScrollingParent
public
interface
NestedScrollingParent
android.support.v4.view.NestedScrollingParent |
![]() |
This interface should be implemented by ViewGroup
subclasses
that wish to support scrolling operations delegated by a nested child view.
Classes implementing this interface should create a final instance of a
NestedScrollingParentHelper
as a field and delegate any View or ViewGroup methods
to the NestedScrollingParentHelper
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 Android
5.0 Lollipop and newer.
Summary
Public methods | |
---|---|
abstract
int
|
getNestedScrollAxes()
Return the current axes of nested scrolling for this NestedScrollingParent. |
abstract
boolean
|
onNestedFling(View target, float velocityX, float velocityY, boolean consumed)
Request a fling from a nested scroll. |
abstract
boolean
|
onNestedPreFling(View target, float velocityX, float velocityY)
React to a nested fling before the target view consumes it. |
abstract
void
|
onNestedPreScroll(View target, int dx, int dy, int[] consumed)
React to a nested scroll in progress before the target view consumes a portion of the scroll. |
abstract
void
|
onNestedScroll(View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed)
React to a nested scroll in progress. |
abstract
void
|
onNestedScrollAccepted(View child, View target, int axes)
React to the successful claiming of a nested scroll operation. |
abstract
boolean
|
onStartNestedScroll(View child, View target, int axes)
React to a descendant view initiating a nestable scroll operation, claiming the nested scroll operation if appropriate. |
abstract
void
|
onStopNestedScroll(View target)
React to a nested scroll operation ending. |
Public methods
getNestedScrollAxes
int getNestedScrollAxes ()
Return the current axes of nested scrolling for this NestedScrollingParent.
A NestedScrollingParent returning something other than SCROLL_AXIS_NONE
is currently acting as a nested scrolling parent for one or more descendant views in
the hierarchy.
Returns | |
---|---|
int |
Flags indicating the current axes of nested scrolling |
onNestedFling
boolean onNestedFling (View target, float velocityX, float velocityY, boolean consumed)
Request a fling from a nested scroll.
This method signifies that a nested scrolling child has detected suitable conditions
for a fling. Generally this means that a touch scroll has ended with a
velocity
in the direction of scrolling that meets or exceeds
the minimum fling velocity
along a scrollable axis.
If a nested scrolling child view would normally fling but it is at the edge of its own content, it can use this method to delegate the fling to its nested scrolling parent instead. The parent may optionally consume the fling or observe a child fling.