# AppBarLayout.ChildScrollEffect

[View Source](https://github.com/material-components/material-components-android/blob/1.14.0/lib/java/com/google/android/material/appbar/AppBarLayout.java)

*** ** * ** ***


```
public abstract class AppBarLayout.ChildScrollEffect
```

<br />

Known direct subclasses [AppBarLayout.CompressChildScrollEffect](https://developer.android.com/reference/com/google/android/material/appbar/AppBarLayout.CompressChildScrollEffect)

|---|---|
| `https://developer.android.com/reference/com/google/android/material/appbar/AppBarLayout.CompressChildScrollEffect` | A class which handles updating an AppBarLayout child, if marked with the ` app:layout_scrollEffect``compress`, at each step in the `AppBarLayout`'s offset animation. |

*** ** * ** ***

An effect class that should be implemented and used by AppBarLayout children to be given effects when the AppBarLayout's offset changes.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/com/google/android/material/appbar/AppBarLayout.ChildScrollEffect#ChildScrollEffect()()` |

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/com/google/android/material/appbar/AppBarLayout.ChildScrollEffect#onOffsetChanged(com.google.android.material.appbar.AppBarLayout,View,float)(https://developer.android.com/reference/com/google/android/material/appbar/AppBarLayout appBarLayout, View child, float offset)` Called each time the AppBarLayout's offset changes. |

## Public constructors

### ChildScrollEffect

```
public ChildScrollEffect()
```

## Public methods

### onOffsetChanged

```
public abstract void onOffsetChanged(AppBarLayout appBarLayout, View child, float offset)
```

Called each time the AppBarLayout's offset changes. Update the `child` with any desired effects.

| Parameters |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/appbar/AppBarLayout appBarLayout` | The parent AppBarLayout |
| `View child` | The View to be given any desired effect |