# ViewParentCompat

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/view/ViewParentCompat.java+class:androidx.core.view.ViewParentCompat) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

*** ** * ** ***

<br />

```
class ViewParentCompat
```

<br />

*** ** * ** ***

Helper for accessing features in `https://developer.android.com/reference/android/view/ViewParent.html`.

## Summary

| ### Public functions |
|---|---|
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/ReplaceWith(expression = "parent.notifySubtreeAccessibilityStateChanged(child, source, changeType)") [notifySubtreeAccessibilityStateChanged](https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#notifySubtreeAccessibilityStateChanged(android.view.ViewParent,android.view.View,android.view.View,int))( parent: https://developer.android.com/reference/android/view/ViewParent.html, child: https://developer.android.com/reference/android/view/View.html, source: https://developer.android.com/reference/android/view/View.html, changeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` **This function is deprecated.** Call notifySubtreeAccessibilityStateChanged directly. <br /> |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onNestedFling(android.view.ViewParent,android.view.View,float,float,boolean)( parent: https://developer.android.com/reference/android/view/ViewParent.html, target: https://developer.android.com/reference/android/view/View.html, velocityX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, velocityY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, consumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Request a fling from a nested scroll. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onNestedPreFling(android.view.ViewParent,android.view.View,float,float)( parent: https://developer.android.com/reference/android/view/ViewParent.html, target: https://developer.android.com/reference/android/view/View.html, velocityX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, velocityY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` React to a nested fling before the target view consumes it. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onNestedPreScroll(android.view.ViewParent,android.view.View,int,int,int[])( parent: https://developer.android.com/reference/android/view/ViewParent.html, target: https://developer.android.com/reference/android/view/View.html, dx: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, dy: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, consumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html> )` React to a nested scroll in progress before the target view consumes a portion of the scroll. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onNestedPreScroll(android.view.ViewParent,android.view.View,int,int,int[],int)( parent: https://developer.android.com/reference/android/view/ViewParent.html, target: https://developer.android.com/reference/android/view/View.html, dx: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, dy: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, consumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>, type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` React to a nested scroll in progress before the target view consumes a portion of the scroll. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onNestedScroll(android.view.ViewParent,android.view.View,int,int,int,int)( parent: https://developer.android.com/reference/android/view/ViewParent.html, target: https://developer.android.com/reference/android/view/View.html, dxConsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, dyConsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, dxUnconsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, dyUnconsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` React to a nested scroll in progress. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onNestedScroll(android.view.ViewParent,android.view.View,int,int,int,int,int)( parent: https://developer.android.com/reference/android/view/ViewParent.html, target: https://developer.android.com/reference/android/view/View.html, dxConsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, dyConsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, dxUnconsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, dyUnconsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` React to a nested scroll in progress. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onNestedScroll(android.view.ViewParent,android.view.View,int,int,int,int,int,int[])( parent: https://developer.android.com/reference/android/view/ViewParent.html, target: https://developer.android.com/reference/android/view/View.html, dxConsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, dyConsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, dxUnconsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, dyUnconsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, consumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html> )` React to a nested scroll in progress. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onNestedScrollAccepted(android.view.ViewParent,android.view.View,android.view.View,int)( parent: https://developer.android.com/reference/android/view/ViewParent.html, child: https://developer.android.com/reference/android/view/View.html, target: https://developer.android.com/reference/android/view/View.html, nestedScrollAxes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` React to the successful claiming of a nested scroll operation. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onNestedScrollAccepted(android.view.ViewParent,android.view.View,android.view.View,int,int)( parent: https://developer.android.com/reference/android/view/ViewParent.html, child: https://developer.android.com/reference/android/view/View.html, target: https://developer.android.com/reference/android/view/View.html, nestedScrollAxes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` React to the successful claiming of a nested scroll operation. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onStartNestedScroll(android.view.ViewParent,android.view.View,android.view.View,int)( parent: https://developer.android.com/reference/android/view/ViewParent.html, child: https://developer.android.com/reference/android/view/View.html, target: https://developer.android.com/reference/android/view/View.html, nestedScrollAxes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` React to a descendant view initiating a nestable scroll operation, claiming the nested scroll operation if appropriate. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onStartNestedScroll(android.view.ViewParent,android.view.View,android.view.View,int,int)( parent: https://developer.android.com/reference/android/view/ViewParent.html, child: https://developer.android.com/reference/android/view/View.html, target: https://developer.android.com/reference/android/view/View.html, nestedScrollAxes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` React to a descendant view initiating a nestable scroll operation, claiming the nested scroll operation if appropriate. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onStopNestedScroll(android.view.ViewParent,android.view.View)(parent: https://developer.android.com/reference/android/view/ViewParent.html, target: https://developer.android.com/reference/android/view/View.html)` React to a nested scroll operation ending. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onStopNestedScroll(android.view.ViewParent,android.view.View,int)(parent: https://developer.android.com/reference/android/view/ViewParent.html, target: https://developer.android.com/reference/android/view/View.html, type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` React to a nested scroll operation ending. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/ReplaceWith(expression = "parent.requestSendAccessibilityEvent(child, event)") [requestSendAccessibilityEvent](https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#requestSendAccessibilityEvent(android.view.ViewParent,android.view.View,android.view.accessibility.AccessibilityEvent))( parent: https://developer.android.com/reference/android/view/ViewParent.html!, child: https://developer.android.com/reference/android/view/View.html!, event: https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html! )` **This function is deprecated.** Use `https://developer.android.com/reference/android/view/ViewParent.html#requestSendAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent)` directly. <br /> |

## Public functions

### notifySubtreeAccessibilityStateChanged

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0) Deprecated in [1.15.0](https://developer.android.com/jetpack/androidx/releases/core#1.15.0)

```
@ReplaceWith(expression = "parent.notifySubtreeAccessibilityStateChanged(child, source, changeType)")
java-static fun [notifySubtreeAccessibilityStateChanged](https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#notifySubtreeAccessibilityStateChanged(android.view.ViewParent,android.view.View,android.view.View,int))(
    parent: ViewParent,
    child: View,
    source: View,
    changeType: Int
): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Call notifySubtreeAccessibilityStateChanged directly.

Notifies a view parent that the accessibility state of one of its descendants has changed and that the structure of the subtree is different.

| Parameters |
|---|---|
| `parent: https://developer.android.com/reference/android/view/ViewParent.html` | ViewParent that contains the target view. |
| `child: https://developer.android.com/reference/android/view/View.html` | The direct child whose subtree has changed. |
| `source: https://developer.android.com/reference/android/view/View.html` | The descendant view that changed. |
| `changeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A bit mask of the types of changes that occurred. One or more of: - `https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html#CONTENT_CHANGE_TYPE_CONTENT_DESCRIPTION` - `https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html#CONTENT_CHANGE_TYPE_SUBTREE` - `https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html#CONTENT_CHANGE_TYPE_TEXT` - `https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html#CONTENT_CHANGE_TYPE_UNDEFINED` |

### onNestedFling

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
java-static fun onNestedFling(
    parent: ViewParent,
    target: View,
    velocityX: Float,
    velocityY: Float,
    consumed: Boolean
): Boolean
```

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 `https://developer.android.com/reference/android/view/VelocityTracker.html` in the direction of scrolling that meets or exceeds the `https://developer.android.com/reference/android/view/ViewConfiguration.html#getScaledMinimumFlingVelocity()` 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 |
|---|---|
| `parent: https://developer.android.com/reference/android/view/ViewParent.html` | ViewParent that contains the target view. |
| `target: https://developer.android.com/reference/android/view/View.html` | View that initiated the nested scroll |
| `velocityX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | Horizontal velocity in pixels per second |
| `velocityY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | Vertical velocity in pixels per second |
| `consumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if the child consumed the fling, false otherwise |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if this parent consumed or otherwise reacted to the fling |

### onNestedPreFling

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
java-static fun onNestedPreFling(
    parent: ViewParent,
    target: View,
    velocityX: Float,
    velocityY: Float
): Boolean
```

React to a nested fling before the target view consumes it.

This method siginfies that a nested scrolling child has detected a fling with the given velocity along each axis. Generally this means that a touch scroll has ended with a `https://developer.android.com/reference/android/view/VelocityTracker.html` in the direction of scrolling that meets or exceeds the `https://developer.android.com/reference/android/view/ViewConfiguration.html#getScaledMinimumFlingVelocity()` along a scrollable axis.

If a nested scrolling parent is consuming motion as part of a `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onNestedPreScroll(android.view.ViewParent,android.view.View,int,int,int[])`, it may be appropriate for it to also consume the pre-fling to complete that same motion. By returning `true` from this method, the parent indicates that the child should not fling its own internal content as well.

| Parameters |
|---|---|
| `parent: https://developer.android.com/reference/android/view/ViewParent.html` | ViewParent that contains the target view. |
| `target: https://developer.android.com/reference/android/view/View.html` | View that initiated the nested scroll |
| `velocityX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | Horizontal velocity in pixels per second |
| `velocityY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | Vertical velocity in pixels per second |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if this parent consumed the fling ahead of the target view |

### onNestedPreScroll

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
java-static fun onNestedPreScroll(
    parent: ViewParent,
    target: View,
    dx: Int,
    dy: Int,
    consumed: IntArray<Int>
): Unit
```

React to a nested scroll in progress before the target view consumes a portion of the scroll.

This version of the method just calls `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onNestedPreScroll(android.view.ViewParent,android.view.View,int,int,int[],int)` using the touch input type.

| Parameters |
|---|---|
| `parent: https://developer.android.com/reference/android/view/ViewParent.html` | ViewParent that contains the target view. |
| `target: https://developer.android.com/reference/android/view/View.html` | View that initiated the nested scroll |
| `dx: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Horizontal scroll distance in pixels |
| `dy: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Vertical scroll distance in pixels |
| `consumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>` | Output. The horizontal and vertical scroll distance consumed by this parent |

### onNestedPreScroll

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
java-static fun onNestedPreScroll(
    parent: ViewParent,
    target: View,
    dx: Int,
    dy: Int,
    consumed: IntArray<Int>,
    type: Int
): Unit
```

React to a nested scroll in progress before the target view consumes a portion of the scroll.

When working with nested scrolling often the parent view may want an opportunity to consume the scroll before the nested scrolling child does. An example of this is a drawer that contains a scrollable list. The user will want to be able to scroll the list fully into view before the list itself begins scrolling.

`onNestedPreScroll` is called when a nested scrolling child invokes `https://developer.android.com/reference/kotlin/androidx/core/view/ViewCompat#dispatchNestedPreScroll(android.view.View,int,int,int[],int[])`. The implementation should report how any pixels of the scroll reported by dx, dy were consumed in the `consumed` array. Index 0 corresponds to dx and index 1 corresponds to dy. This parameter will never be null. Initial values for consumed\[0\] and consumed\[1\] will always be 0.

| Parameters |
|---|---|
| `parent: https://developer.android.com/reference/android/view/ViewParent.html` | ViewParent that contains the target view. |
| `target: https://developer.android.com/reference/android/view/View.html` | View that initiated the nested scroll |
| `dx: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Horizontal scroll distance in pixels |
| `dy: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Vertical scroll distance in pixels |
| `consumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>` | Output. The horizontal and vertical scroll distance consumed by this parent |
| `type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the type of input which cause this scroll event |

### onNestedScroll

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
java-static fun onNestedScroll(
    parent: ViewParent,
    target: View,
    dxConsumed: Int,
    dyConsumed: Int,
    dxUnconsumed: Int,
    dyUnconsumed: Int
): Unit
```

React to a nested scroll in progress.

This version of the method just calls `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onNestedScroll(android.view.ViewParent,android.view.View,int,int,int,int,int)` using the touch input type.

| Parameters |
|---|---|
| `parent: https://developer.android.com/reference/android/view/ViewParent.html` | ViewParent that contains the target view. |
| `target: https://developer.android.com/reference/android/view/View.html` | The descendent view controlling the nested scroll |
| `dxConsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Horizontal scroll distance in pixels already consumed by target |
| `dyConsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Vertical scroll distance in pixels already consumed by target |
| `dxUnconsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Horizontal scroll distance in pixels not consumed by target |
| `dyUnconsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Vertical scroll distance in pixels not consumed by target |

### onNestedScroll

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
java-static fun onNestedScroll(
    parent: ViewParent,
    target: View,
    dxConsumed: Int,
    dyConsumed: Int,
    dxUnconsumed: Int,
    dyUnconsumed: Int,
    type: Int
): Unit
```

React to a nested scroll in progress.

This method will be called when the ViewParent's current nested scrolling child view dispatches a nested scroll event. To receive calls to this method the ViewParent must have previously returned `true` for a call to `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onStartNestedScroll(android.view.ViewParent,android.view.View,android.view.View,int,int)`.

Both the consumed and unconsumed portions of the scroll distance are reported to the ViewParent. An implementation may choose to use the consumed portion to match or chase scroll position of multiple child elements, for example. The unconsumed portion may be used to allow continuous dragging of multiple scrolling or draggable elements, such as scrolling a list within a vertical drawer where the drawer begins dragging once the edge of inner scrolling content is reached.

| Parameters |
|---|---|
| `parent: https://developer.android.com/reference/android/view/ViewParent.html` | ViewParent that contains the target view. |
| `target: https://developer.android.com/reference/android/view/View.html` | The descendant view controlling the nested scroll |
| `dxConsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Horizontal scroll distance in pixels already consumed by target |
| `dyConsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Vertical scroll distance in pixels already consumed by target |
| `dxUnconsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Horizontal scroll distance in pixels not consumed by target |
| `dyUnconsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Vertical scroll distance in pixels not consumed by target |
| `type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the type of input which cause this scroll event |

### onNestedScroll

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
java-static fun onNestedScroll(
    parent: ViewParent,
    target: View,
    dxConsumed: Int,
    dyConsumed: Int,
    dxUnconsumed: Int,
    dyUnconsumed: Int,
    type: Int,
    consumed: IntArray<Int>
): Unit
```

React to a nested scroll in progress.

This method will be called when the ViewParent's current nested scrolling child view dispatches a nested scroll event. To receive calls to this method the ViewParent must have previously returned `true` for a call to `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onStartNestedScroll(android.view.ViewParent,android.view.View,android.view.View,int,int)`.

Both the consumed and unconsumed portions of the scroll distance are reported to the ViewParent. An implementation may choose to use the consumed portion to match or chase scroll position of multiple child elements, for example. The unconsumed portion may be used to allow continuous dragging of multiple scrolling or draggable elements, such as scrolling a list within a vertical drawer where the drawer begins dragging once the edge of inner scrolling content is reached.

| Parameters |
|---|---|
| `parent: https://developer.android.com/reference/android/view/ViewParent.html` | ViewParent that contains the target view. |
| `target: https://developer.android.com/reference/android/view/View.html` | The descendent view controlling the nested scroll |
| `dxConsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Horizontal scroll distance in pixels already consumed by target |
| `dyConsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Vertical scroll distance in pixels already consumed by target |
| `dxUnconsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Horizontal scroll distance in pixels not consumed by target |
| `dyUnconsumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Vertical scroll distance in pixels not consumed by target |
| `type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the type of input which cause this scroll event |
| `consumed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>` | Output. If not null, upon this method returning, will contain the scroll distances consumed by this nested scrolling parent and the scroll distances consumed by any other parent up the view hierarchy. |

### onNestedScrollAccepted

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
java-static fun onNestedScrollAccepted(
    parent: ViewParent,
    child: View,
    target: View,
    nestedScrollAxes: Int
): Unit
```

React to the successful claiming of a nested scroll operation.

This version of the method just calls `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onNestedScrollAccepted(android.view.ViewParent,android.view.View,android.view.View,int,int)` using the touch input type.

| Parameters |
|---|---|
| `parent: https://developer.android.com/reference/android/view/ViewParent.html` | ViewParent that contains the child view. |
| `child: https://developer.android.com/reference/android/view/View.html` | Direct child of this ViewParent containing target |
| `target: https://developer.android.com/reference/android/view/View.html` | View that initiated the nested scroll |
| `nestedScrollAxes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Flags consisting of `https://developer.android.com/reference/kotlin/androidx/core/view/ViewCompat#SCROLL_AXIS_HORIZONTAL()`, `https://developer.android.com/reference/kotlin/androidx/core/view/ViewCompat#SCROLL_AXIS_VERTICAL()` or both |

### onNestedScrollAccepted

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
java-static fun onNestedScrollAccepted(
    parent: ViewParent,
    child: View,
    target: View,
    nestedScrollAxes: Int,
    type: Int
): Unit
```

React to the successful claiming of a nested scroll operation.

This method will be called after `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onStartNestedScroll(android.view.ViewParent,android.view.View,android.view.View,int)` returns true. It offers an opportunity for the view and its superclasses to perform initial configuration for the nested scroll. Implementations of this method should always call their superclass's implementation of this method if one is present.

| Parameters |
|---|---|
| `parent: https://developer.android.com/reference/android/view/ViewParent.html` | ViewParent that contains the child view. |
| `child: https://developer.android.com/reference/android/view/View.html` | Direct child of this ViewParent containing target |
| `target: https://developer.android.com/reference/android/view/View.html` | View that initiated the nested scroll |
| `nestedScrollAxes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Flags consisting of `https://developer.android.com/reference/kotlin/androidx/core/view/ViewCompat#SCROLL_AXIS_HORIZONTAL()`, `https://developer.android.com/reference/kotlin/androidx/core/view/ViewCompat#SCROLL_AXIS_VERTICAL()` or both |
| `type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the type of input which cause this scroll event |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onStartNestedScroll(android.view.ViewParent,android.view.View,android.view.View,int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onStopNestedScroll(android.view.ViewParent,android.view.View,int)` |   |

### onStartNestedScroll

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
java-static fun onStartNestedScroll(
    parent: ViewParent,
    child: View,
    target: View,
    nestedScrollAxes: Int
): Boolean
```

React to a descendant view initiating a nestable scroll operation, claiming the nested scroll operation if appropriate.

This version of the method just calls `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onStartNestedScroll(android.view.ViewParent,android.view.View,android.view.View,int,int)` using the touch input type.

| Parameters |
|---|---|
| `parent: https://developer.android.com/reference/android/view/ViewParent.html` | ViewParent that contains the child view. |
| `child: https://developer.android.com/reference/android/view/View.html` | Direct child of this ViewParent containing target |
| `target: https://developer.android.com/reference/android/view/View.html` | View that initiated the nested scroll |
| `nestedScrollAxes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Flags consisting of `https://developer.android.com/reference/kotlin/androidx/core/view/ViewCompat#SCROLL_AXIS_HORIZONTAL()`, `https://developer.android.com/reference/kotlin/androidx/core/view/ViewCompat#SCROLL_AXIS_VERTICAL()` or both |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if this ViewParent accepts the nested scroll operation |

### onStartNestedScroll

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
java-static fun onStartNestedScroll(
    parent: ViewParent,
    child: View,
    target: View,
    nestedScrollAxes: Int,
    type: Int
): Boolean
```

React to a descendant view initiating a nestable scroll operation, claiming the nested scroll operation if appropriate.

This method will be called in response to a descendant view invoking `https://developer.android.com/reference/kotlin/androidx/core/view/ViewCompat#startNestedScroll(android.view.View,int)`. Each parent up the view hierarchy will be given an opportunity to respond and claim the nested scrolling operation by returning `true`.

This method may be overridden by ViewParent implementations to indicate when the view is willing to support a nested scrolling operation that is about to begin. If it returns true, this ViewParent will become the target view's nested scrolling parent for the duration of the scroll operation in progress. When the nested scroll is finished this ViewParent will receive a call to `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onStopNestedScroll(android.view.ViewParent,android.view.View,int)`.

| Parameters |
|---|---|
| `parent: https://developer.android.com/reference/android/view/ViewParent.html` | ViewParent that contains the child view. |
| `child: https://developer.android.com/reference/android/view/View.html` | Direct child of this ViewParent containing target |
| `target: https://developer.android.com/reference/android/view/View.html` | View that initiated the nested scroll |
| `nestedScrollAxes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Flags consisting of `https://developer.android.com/reference/kotlin/androidx/core/view/ViewCompat#SCROLL_AXIS_HORIZONTAL()`, `https://developer.android.com/reference/kotlin/androidx/core/view/ViewCompat#SCROLL_AXIS_VERTICAL()` or both |
| `type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the type of input which cause this scroll event |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if this ViewParent accepts the nested scroll operation |

### onStopNestedScroll

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
java-static fun onStopNestedScroll(parent: ViewParent, target: View): Unit
```

React to a nested scroll operation ending.

This version of the method just calls `https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#onStopNestedScroll(android.view.ViewParent,android.view.View,int)` using the touch input type.

| Parameters |
|---|---|
| `parent: https://developer.android.com/reference/android/view/ViewParent.html` | ViewParent that contains the target view. |
| `target: https://developer.android.com/reference/android/view/View.html` | View that initiated the nested scroll |

### onStopNestedScroll

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
java-static fun onStopNestedScroll(parent: ViewParent, target: View, type: Int): Unit
```

React to a nested scroll operation ending.

Perform cleanup after a nested scrolling operation. This method will be called when a nested scroll stops, for example when a nested touch scroll ends with a `https://developer.android.com/reference/android/view/MotionEvent.html#ACTION_UP` or `https://developer.android.com/reference/android/view/MotionEvent.html#ACTION_CANCEL` event. Implementations of this method should always call their superclass's implementation of this method if one is present.

| Parameters |
|---|---|
| `parent: https://developer.android.com/reference/android/view/ViewParent.html` | ViewParent that contains the target view. |
| `target: https://developer.android.com/reference/android/view/View.html` | View that initiated the nested scroll |
| `type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the type of input which cause this scroll event |

### requestSendAccessibilityEvent

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
@ReplaceWith(expression = "parent.requestSendAccessibilityEvent(child, event)")
java-static fun [requestSendAccessibilityEvent](https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat#requestSendAccessibilityEvent(android.view.ViewParent,android.view.View,android.view.accessibility.AccessibilityEvent))(
    parent: ViewParent!,
    child: View!,
    event: AccessibilityEvent!
): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/android/view/ViewParent.html#requestSendAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent)` directly.

Called by a child to request from its parent to send an `https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html`. The child has already populated a record for itself in the event and is delegating to its parent to send the event. The parent can optionally add a record for itself.

Note: An accessibility event is fired by an individual view which populates the event with a record for its state and requests from its parent to perform the sending. The parent can optionally add a record for itself before dispatching the request to its parent. A parent can also choose not to respect the request for sending the event. The accessibility event is sent by the topmost view in the view tree.

| Parameters |
|---|---|
| `parent: https://developer.android.com/reference/android/view/ViewParent.html!` | The parent whose method to invoke. |
| `child: https://developer.android.com/reference/android/view/View.html!` | The child which requests sending the event. |
| `event: https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html!` | The event to be sent. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | True if the event was sent. |