# TimeBar.OnScrubListener

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/ui/TimeBar.OnScrubListener "View this page in Java")

<br />

```
interface TimeBar.OnScrubListener
```

<br />

*** ** * ** ***

Listener for scrubbing events.

## Summary

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onScrubMove](https://developer.android.com/reference/kotlin/androidx/media3/ui/TimeBar.OnScrubListener#onScrubMove(androidx.media3.ui.TimeBar,long))`(timeBar: `[TimeBar](https://developer.android.com/reference/kotlin/androidx/media3/ui/TimeBar)`!, position: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Called when the user moves the scrubber.                                                                                                                 |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onScrubStart](https://developer.android.com/reference/kotlin/androidx/media3/ui/TimeBar.OnScrubListener#onScrubStart(androidx.media3.ui.TimeBar,long))`(timeBar: `[TimeBar](https://developer.android.com/reference/kotlin/androidx/media3/ui/TimeBar)`!, position: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Called when the user starts moving the scrubber.                                                                                                       |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onScrubStop](https://developer.android.com/reference/kotlin/androidx/media3/ui/TimeBar.OnScrubListener#onScrubStop(androidx.media3.ui.TimeBar,long,boolean))`(timeBar: `[TimeBar](https://developer.android.com/reference/kotlin/androidx/media3/ui/TimeBar)`!, position: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`, canceled: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Called when the user stops moving the scrubber. |

## Public functions

### onScrubMove

```
fun onScrubMove(timeBar: TimeBar!, position: Long): Unit
```

Called when the user moves the scrubber.  

|                                             Parameters                                             |
|----------------------------------------------------------------------------------------------------|-------------------------------------|
| `timeBar: `[TimeBar](https://developer.android.com/reference/kotlin/androidx/media3/ui/TimeBar)`!` | The time bar.                       |
| `position: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)          | The scrub position in milliseconds. |

### onScrubStart

```
fun onScrubStart(timeBar: TimeBar!, position: Long): Unit
```

Called when the user starts moving the scrubber.  

|                                             Parameters                                             |
|----------------------------------------------------------------------------------------------------|-------------------------------------|
| `timeBar: `[TimeBar](https://developer.android.com/reference/kotlin/androidx/media3/ui/TimeBar)`!` | The time bar.                       |
| `position: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)          | The scrub position in milliseconds. |

### onScrubStop

```
fun onScrubStop(timeBar: TimeBar!, position: Long, canceled: Boolean): Unit
```

Called when the user stops moving the scrubber.  

|                                             Parameters                                             |
|----------------------------------------------------------------------------------------------------|-------------------------------------|
| `timeBar: `[TimeBar](https://developer.android.com/reference/kotlin/androidx/media3/ui/TimeBar)`!` | The time bar.                       |
| `position: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)          | The scrub position in milliseconds. |
| `canceled: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)    | Whether scrubbing was canceled.     |