# BottomSheetBehavior.BottomSheetCallback

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

*** ** * ** ***


```
public abstract class BottomSheetBehavior.BottomSheetCallback
```

<br />

*** ** * ** ***

Callback for monitoring events about bottom sheets.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetBehavior.BottomSheetCallback#BottomSheetCallback()()` |

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetBehavior.BottomSheetCallback#onSlide(View,float)(View bottomSheet, float slideOffset)` Called when the bottom sheet is being dragged. |
| `abstract void` | `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetBehavior.BottomSheetCallback#onStateChanged(View,int)(View bottomSheet, int newState)` Called when the bottom sheet changes its state. |

## Public constructors

### BottomSheetCallback

```
public BottomSheetCallback()
```

## Public methods

### onSlide

```
public abstract void onSlide(View bottomSheet, float slideOffset)
```

Called when the bottom sheet is being dragged.

| Parameters |
|---|---|
| `View bottomSheet` | The bottom sheet view. |
| `float slideOffset` | The new offset of this bottom sheet within \[-1,1\] range. Offset increases as this bottom sheet is moving upward. From 0 to 1 the sheet is between collapsed and expanded states and from -1 to 0 it is between hidden and collapsed states. |

### onStateChanged

```
public abstract void onStateChanged(View bottomSheet, int newState)
```

Called when the bottom sheet changes its state.

| Parameters |
|---|---|
| `View bottomSheet` | The bottom sheet view. |
| `int newState` | The new state. This will be one of `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetBehavior#STATE_DRAGGING()`, `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetBehavior#STATE_SETTLING()`, `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetBehavior#STATE_EXPANDED()`, `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetBehavior#STATE_COLLAPSED()`, `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetBehavior#STATE_HIDDEN()`, or `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetBehavior#STATE_HALF_EXPANDED()`. |