added in version 22.1.0
belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1

NestedScrollingChild

public interface NestedScrollingChild

android.support.v4.view.NestedScrollingChild
Known Indirect Subclasses


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 Android 5.0 Lollipop and newer.

Summary

Public methods

abstract boolean dispatchNestedFling(float velocityX, float velocityY, boolean consumed)

Dispatch a fling to a nested scrolling parent.

abstract boolean dispatchNestedPreFling(float velocityX, float velocityY)

Dispatch a fling to a nested scrolling parent before it is processed by this view.

abstract boolean dispatchNestedPreScroll(int dx, int dy, int[] consumed, int[] offsetInWindow)

Dispatch one step of a nested scroll in progress before this view consumes any portion of it.

abstract boolean dispatchNestedScroll(int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int[] offsetInWindow)

Dispatch one step of a nested scroll in progress.

abstract boolean hasNestedScrollingParent()

Returns true if this view has a nested scrolling parent.

abstract boolean isNestedScrollingEnabled()

Returns true if nested scrolling is enabled for this view.

abstract void setNestedScrollingEnabled(boolean enabled)

Enable or disable nested scrolling for this view.

abstract boolean startNestedScroll(int axes)

Begin a nestable scroll operation along the given axes.

abstract void stopNestedScroll()

Stop a nested scroll in progress.

Public methods

dispatchNestedFling

added in version 22.1.0
boolean dispatchNestedFling (float velocityX, 
                float velocityY, 
                boolean consumed)

Dispatch a fling to a nested scrolling parent.

This method should be used to indicate 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.

Parameters