# NumberPicker.OnScrollListener

Added in[API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# OnScrollListener

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/widget/NumberPicker.OnScrollListener "View this page in Java")  

```
interface OnScrollListener
```

|----------------------------------------------------------------------------------------------------------------------------------------------|
| [android.widget.NumberPicker.OnScrollListener](https://developer.android.com/reference/kotlin/android/widget/NumberPicker.OnScrollListener#) |

Interface to listen for the picker scroll state.

## Summary

|                                                                                                                                                          Constants                                                                                                                                                          ||
|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SCROLL_STATE_FLING](https://developer.android.com/reference/kotlin/android/widget/NumberPicker.OnScrollListener#SCROLL_STATE_FLING:kotlin.Int) The user had previously been scrolling using touch and performed a fling.                 |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SCROLL_STATE_IDLE](https://developer.android.com/reference/kotlin/android/widget/NumberPicker.OnScrollListener#SCROLL_STATE_IDLE:kotlin.Int) The view is not scrolling.                                                                  |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SCROLL_STATE_TOUCH_SCROLL](https://developer.android.com/reference/kotlin/android/widget/NumberPicker.OnScrollListener#SCROLL_STATE_TOUCH_SCROLL:kotlin.Int) The user is scrolling using touch, and their finger is still on the screen. |

|                                                                                                                                                                                                                                                                  Public methods                                                                                                                                                                                                                                                                  ||
|--------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onScrollStateChange](https://developer.android.com/reference/kotlin/android/widget/NumberPicker.OnScrollListener#onScrollStateChange(android.widget.NumberPicker,%20kotlin.Int))`(`view:` `[NumberPicker](https://developer.android.com/reference/kotlin/android/widget/NumberPicker)!`, `scrollState:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Callback invoked while the number picker scroll state has changed. |

## Constants

### SCROLL_STATE_FLING

Added in[API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SCROLL_STATE_FLING: Int
```

The user had previously been scrolling using touch and performed a fling.  

    Value: 2

### SCROLL_STATE_IDLE

Added in[API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SCROLL_STATE_IDLE: Int
```

The view is not scrolling.  

    Value: 0

### SCROLL_STATE_TOUCH_SCROLL

Added in[API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SCROLL_STATE_TOUCH_SCROLL: Int
```

The user is scrolling using touch, and their finger is still on the screen.  

    Value: 1

## Public methods

### onScrollStateChange

Added in[API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun onScrollStateChange(
    view: NumberPicker!, 
    scrollState: Int
): Unit
```

Callback invoked while the number picker scroll state has changed.

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ||
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `view`        | [NumberPicker](https://developer.android.com/reference/kotlin/android/widget/NumberPicker)!:The view whose scroll state is being reported.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `scrollState` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The current scroll state. One of[SCROLL_STATE_IDLE](https://developer.android.com/reference/kotlin/android/widget/NumberPicker.OnScrollListener#SCROLL_STATE_IDLE:kotlin.Int),[SCROLL_STATE_TOUCH_SCROLL](https://developer.android.com/reference/kotlin/android/widget/NumberPicker.OnScrollListener#SCROLL_STATE_TOUCH_SCROLL:kotlin.Int)or[SCROLL_STATE_IDLE](https://developer.android.com/reference/kotlin/android/widget/NumberPicker.OnScrollListener#SCROLL_STATE_IDLE:kotlin.Int). Value is[android.widget.NumberPicker.OnScrollListener#SCROLL_STATE_IDLE](https://developer.android.com/reference/kotlin/android/widget/NumberPicker.OnScrollListener#SCROLL_STATE_IDLE:kotlin.Int),[android.widget.NumberPicker.OnScrollListener#SCROLL_STATE_TOUCH_SCROLL](https://developer.android.com/reference/kotlin/android/widget/NumberPicker.OnScrollListener#SCROLL_STATE_TOUCH_SCROLL:kotlin.Int), or[android.widget.NumberPicker.OnScrollListener#SCROLL_STATE_FLING](https://developer.android.com/reference/kotlin/android/widget/NumberPicker.OnScrollListener#SCROLL_STATE_FLING:kotlin.Int) |