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

AndroidFlingSpline

object AndroidFlingSpline
kotlin.Any
   ↳ androidx.ui.foundation.animation.AndroidFlingSpline

The native Android fling scroll spline and the ability to sample it.

Ported from android.widget.Scroller.

Summary

Nested classes

data

Result coefficients of a scroll computation

Public methods

Double
deceleration(velocity: Float, friction: Float)

The rate of deceleration along the spline motion given velocity and friction.

AndroidFlingSpline.FlingResult

Compute an instantaneous fling position along the scroller spline.

Public methods

deceleration

fun deceleration(
    velocity: Float,
    friction: Float
): Double

The rate of deceleration along the spline motion given velocity and friction.

flingPosition

fun flingPosition(time: Float): AndroidFlingSpline.FlingResult

Compute an instantaneous fling position along the scroller spline.

Parameters
time: Float progress through the fling animation from 0-1