The Developer Preview for Android 11 is now available; test it out and share your feedback.

SmoothScrollByBehavior

interface SmoothScrollByBehavior
androidx.leanback.widget.BaseGridView.SmoothScrollByBehavior

Defines behavior of duration and interpolator for smoothScrollBy().

Summary

Public methods

abstract Int

Defines duration in milliseconds of smoothScrollBy().

abstract Interpolator?

Defines interpolator of smoothScrollBy().

Public methods

configSmoothScrollByDuration

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

Defines duration in milliseconds of smoothScrollBy().

Parameters
dx Int: x distance in pixels.
dy Int: y distance in pixels.
Return
Int Duration in milliseconds or UNDEFINED_DURATION for default value.

configSmoothScrollByInterpolator

@Nullable abstract fun configSmoothScrollByInterpolator(
    dx: Int,
    dy: Int
): Interpolator?

Defines interpolator of smoothScrollBy().

Parameters
dx Int: x distance in pixels.
dy Int: y distance in pixels.
Return
Interpolator? Interpolator to be used or null for default interpolator.