public class NestedScrollingParentHelper extends Object
ViewGroup
subclasses should instantiate a final instance
of this class as a field at construction. For each ViewGroup
method that has
a matching method signature in this class, delegate the operation to the helper instance
in an overridden method implementation. This implements the standard framework policy
for nested scrolling.
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.
Constructor and Description |
---|
NestedScrollingParentHelper(ViewGroup viewGroup)
Construct a new helper for a given ViewGroup
|
Modifier and Type | Method and Description |
---|---|
int |
getNestedScrollAxes()
Return the current axes of nested scrolling for this ViewGroup.
|
void |
onNestedScrollAccepted(View child,
View target,
int axes)
Called when a nested scrolling operation initiated by a descendant view is accepted
by this ViewGroup.
|
void |
onStopNestedScroll(View target)
React to a nested scroll operation ending.
|
public NestedScrollingParentHelper(ViewGroup viewGroup)
public void onNestedScrollAccepted(View child, View target, int axes)
This is a delegate method. Call it from your ViewGroup
subclass method/NestedScrollingParent
interface method with
the same signature to implement the standard policy.
public int getNestedScrollAxes()
This is a delegate method. Call it from your ViewGroup
subclass method/NestedScrollingParent
interface method with
the same signature to implement the standard policy.
public void onStopNestedScroll(View target)
This is a delegate method. Call it from your ViewGroup
subclass method/NestedScrollingParent
interface method with
the same signature to implement the standard policy.
target
- View that initiated the nested scroll