# TimeBar.OnScrubListener

Artifact: [androidx.media3:media3-ui](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/TimeBar.java+class:androidx.media3.ui.TimeBar.OnScrubListener)

*** ** * ** ***


```
public interface TimeBar.OnScrubListener
```

<br />

*** ** * ** ***

Listener for scrubbing events.

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/media3/ui/TimeBar.OnScrubListener#onScrubMove(androidx.media3.ui.TimeBar,long)(https://developer.android.com/reference/androidx/media3/ui/TimeBar timeBar, long position)` Called when the user moves the scrubber. |
| `abstract void` | `https://developer.android.com/reference/androidx/media3/ui/TimeBar.OnScrubListener#onScrubStart(androidx.media3.ui.TimeBar,long)(https://developer.android.com/reference/androidx/media3/ui/TimeBar timeBar, long position)` Called when the user starts moving the scrubber. |
| `abstract void` | `https://developer.android.com/reference/androidx/media3/ui/TimeBar.OnScrubListener#onScrubStop(androidx.media3.ui.TimeBar,long,boolean)(https://developer.android.com/reference/androidx/media3/ui/TimeBar timeBar, long position, boolean canceled)` Called when the user stops moving the scrubber. |

## Public methods

### onScrubMove

```
abstract void onScrubMove(TimeBar timeBar, long position)
```

Called when the user moves the scrubber.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/ui/TimeBar timeBar` | The time bar. |
| `long position` | The scrub position in milliseconds. |

### onScrubStart

```
abstract void onScrubStart(TimeBar timeBar, long position)
```

Called when the user starts moving the scrubber.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/ui/TimeBar timeBar` | The time bar. |
| `long position` | The scrub position in milliseconds. |

### onScrubStop

```
abstract void onScrubStop(TimeBar timeBar, long position, boolean canceled)
```

Called when the user stops moving the scrubber.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/ui/TimeBar timeBar` | The time bar. |
| `long position` | The scrub position in milliseconds. |
| `boolean canceled` | Whether scrubbing was canceled. |