-
- All Implemented Interfaces:
-
tds.androidx.core.view.NestedScrollingParent
,tds.androidx.core.view.NestedScrollingParent2
public interface NestedScrollingParent3 implements NestedScrollingParent2
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 all versions of Android.
-
-
Method Summary
Modifier and Type Method Description abstract void
onNestedScroll(@NonNull() View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int type, @NonNull() Array<int> consumed)
React to a nested scroll in progress. -
Methods inherited from class tds.androidx.core.view.NestedScrollingParent2
onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onStartNestedScroll, onStopNestedScroll
-
Methods inherited from class tds.androidx.core.view.NestedScrollingParent
getNestedScrollAxes, onNestedFling, onNestedPreFling, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onStartNestedScroll, onStopNestedScroll
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
onNestedScroll
abstract void onNestedScroll(@NonNull() View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int type, @NonNull() Array<int> consumed)
React to a nested scroll in progress.
This method will be called when the ViewParent's current nested scrolling child viewdispatches a nested scroll event. To receive calls to this method the ViewParent must havepreviously returned
true
for a call to onStartNestedScroll.Both the consumed and unconsumed portions of the scroll distance are reported to theViewParent. An implementation may choose to use the consumed portion to match or chase scrollposition of multiple child elements, for example. The unconsumed portion may be used toallow continuous dragging of multiple scrolling or draggable elements, such as scrollinga list within a vertical drawer where the drawer begins dragging once the edge of innerscrolling content is reached.
This method is called when a nested scrolling child invokes dispatchNestedScroll} orone of methods it overloads.
An implementation must report how many pixels of the the x and y scroll distances wereconsumed by this nested scrolling parent by adding the consumed distances to the
consumed
parameter. If this View also implements NestedScrollingChild3,consumed
should also be passed up to it's nested scrolling parent so that theparent may also add any scroll distance it consumes. Index 0 corresponds to dx and index 1corresponds to dy.- Parameters:
target
- The descendant view controlling the nested scrolldxConsumed
- Horizontal scroll distance in pixels already consumed by targetdyConsumed
- Vertical scroll distance in pixels already consumed by targetdxUnconsumed
- Horizontal scroll distance in pixels not consumed by targetdyUnconsumed
- Vertical scroll distance in pixels not consumed by targettype
- the type of input which cause this scroll eventconsumed
- Output.
-
-
-
-