# NestedScrollingParentHelper

# NestedScrollingParentHelper

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

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/core/view/NestedScrollingParentHelper "View this page in Java")

<br />

```
class NestedScrollingParentHelper
```

<br />

*** ** * ** ***

Helper class for implementing nested scrolling parent views compatible with Android platform versions earlier than Android 5.0 Lollipop (API 21).

[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup.html)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[androidx.core.view.ViewCompat](https://developer.android.com/reference/kotlin/androidx/core/view/ViewCompat),[androidx.core.view.ViewGroupCompat](https://developer.android.com/reference/kotlin/androidx/core/view/ViewGroupCompat)or[androidx.core.view.ViewParentCompat](https://developer.android.com/reference/kotlin/androidx/core/view/ViewParentCompat)compatibility shim static methods. This ensures interoperability with nested scrolling views on Android 5.0 Lollipop and newer.

## Summary

|                                                                                                                                                    ### Public constructors                                                                                                                                                     |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [NestedScrollingParentHelper](https://developer.android.com/reference/kotlin/androidx/core/view/NestedScrollingParentHelper#NestedScrollingParentHelper(android.view.ViewGroup))`(viewGroup: `[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup.html)`)` Construct a new helper for a given ViewGroup |

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)   | [getNestedScrollAxes](https://developer.android.com/reference/kotlin/androidx/core/view/NestedScrollingParentHelper#getNestedScrollAxes())`()` Return the current axes of nested scrolling for this ViewGroup.                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onNestedScrollAccepted](https://developer.android.com/reference/kotlin/androidx/core/view/NestedScrollingParentHelper#onNestedScrollAccepted(android.view.View,android.view.View,int))`(child: `[View](https://developer.android.com/reference/android/view/View.html)`, target: `[View](https://developer.android.com/reference/android/view/View.html)`, axes: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Called when a nested scrolling operation initiated by a descendant view is accepted by this ViewGroup.                                                                                          |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onNestedScrollAccepted](https://developer.android.com/reference/kotlin/androidx/core/view/NestedScrollingParentHelper#onNestedScrollAccepted(android.view.View,android.view.View,int,int))`(child: `[View](https://developer.android.com/reference/android/view/View.html)`, target: `[View](https://developer.android.com/reference/android/view/View.html)`, axes: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, type: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Called when a nested scrolling operation initiated by a descendant view is accepted by this ViewGroup. |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onStopNestedScroll](https://developer.android.com/reference/kotlin/androidx/core/view/NestedScrollingParentHelper#onStopNestedScroll(android.view.View))`(target: `[View](https://developer.android.com/reference/android/view/View.html)`)` React to a nested scroll operation ending.                                                                                                                                                                                                                                                                                                                                                          |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onStopNestedScroll](https://developer.android.com/reference/kotlin/androidx/core/view/NestedScrollingParentHelper#onStopNestedScroll(android.view.View,int))`(target: `[View](https://developer.android.com/reference/android/view/View.html)`, type: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` React to a nested scroll operation ending.                                                                                                                                                                                                                                                                 |

## Public constructors

### NestedScrollingParentHelper

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

```
NestedScrollingParentHelper(viewGroup: ViewGroup)
```

Construct a new helper for a given ViewGroup  

## Public functions

### getNestedScrollAxes

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

```
fun getNestedScrollAxes(): Int
```

Return the current axes of nested scrolling for this ViewGroup.

This is a delegate method. Call it from your[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup.html)subclass method/[androidx.core.view.NestedScrollingParent](https://developer.android.com/reference/kotlin/androidx/core/view/NestedScrollingParent)interface method with the same signature to implement the standard policy.  

### onNestedScrollAccepted

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

```
fun onNestedScrollAccepted(child: View, target: View, axes: Int): Unit
```

Called when a nested scrolling operation initiated by a descendant view is accepted by this ViewGroup.

This is a delegate method. Call it from your[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup.html)subclass method/[androidx.core.view.NestedScrollingParent](https://developer.android.com/reference/kotlin/androidx/core/view/NestedScrollingParent)interface method with the same signature to implement the standard policy.  

### onNestedScrollAccepted

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

```
fun onNestedScrollAccepted(child: View, target: View, axes: Int, type: Int): Unit
```

Called when a nested scrolling operation initiated by a descendant view is accepted by this ViewGroup.

This is a delegate method. Call it from your[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup.html)subclass method/[androidx.core.view.NestedScrollingParent2](https://developer.android.com/reference/kotlin/androidx/core/view/NestedScrollingParent2)interface method with the same signature to implement the standard policy.  

### onStopNestedScroll

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

```
fun onStopNestedScroll(target: View): Unit
```

React to a nested scroll operation ending.

This is a delegate method. Call it from your[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup.html)subclass method/[androidx.core.view.NestedScrollingParent](https://developer.android.com/reference/kotlin/androidx/core/view/NestedScrollingParent)interface method with the same signature to implement the standard policy.  

### onStopNestedScroll

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

```
fun onStopNestedScroll(target: View, type: Int): Unit
```

React to a nested scroll operation ending.

This is a delegate method. Call it from your[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup.html)subclass method/[androidx.core.view.NestedScrollingParent2](https://developer.android.com/reference/kotlin/androidx/core/view/NestedScrollingParent2)interface method with the same signature to implement the standard policy.