# BaseGridView.SmoothScrollByBehavior

# BaseGridView.SmoothScrollByBehavior

Artifact:[androidx.leanback:leanback-grid](https://developer.android.com/jetpack/androidx/releases/leanback)  
[View Source](https://cs.android.com/search?q=file:androidx/leanback/widget/BaseGridView.java+class:androidx.leanback.widget.BaseGridView.SmoothScrollByBehavior)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/leanback/widget/BaseGridView.SmoothScrollByBehavior "View this page in Java")

<br />

```
interface BaseGridView.SmoothScrollByBehavior
```

<br />

*** ** * ** ***

Defines behavior of duration and interpolator for smoothScrollBy().

## Summary

|                                        ### Public functions                                         |
|-----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                         | [configSmoothScrollByDuration](https://developer.android.com/reference/kotlin/androidx/leanback/widget/BaseGridView.SmoothScrollByBehavior#configSmoothScrollByDuration(int,int))`(dx: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, dy: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Defines duration in milliseconds of smoothScrollBy(). |
| [Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator.html)`?` | [configSmoothScrollByInterpolator](https://developer.android.com/reference/kotlin/androidx/leanback/widget/BaseGridView.SmoothScrollByBehavior#configSmoothScrollByInterpolator(int,int))`(dx: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, dy: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Defines interpolator of smoothScrollBy().     |

## Public functions

### configSmoothScrollByDuration

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.0.0)  

```
fun configSmoothScrollByDuration(dx: Int, dy: Int): Int
```

Defines duration in milliseconds of smoothScrollBy().  

|                                    Parameters                                     |
|-----------------------------------------------------------------------------------|-----------------------|
| `dx: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | x distance in pixels. |
| `dy: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | y distance in pixels. |

|                                   Returns                                   |
|-----------------------------------------------------------------------------|-------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Duration in milliseconds or UNDEFINED_DURATION for default value. |

### configSmoothScrollByInterpolator

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.0.0)  

```
fun configSmoothScrollByInterpolator(dx: Int, dy: Int): Interpolator?
```

Defines interpolator of smoothScrollBy().  

|                                    Parameters                                     |
|-----------------------------------------------------------------------------------|-----------------------|
| `dx: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | x distance in pixels. |
| `dy: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | y distance in pixels. |

|                                               Returns                                               |
|-----------------------------------------------------------------------------------------------------|-----------------------------------------------------------|
| [Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator.html)`?` | Interpolator to be used or null for default interpolator. |