startValueAnimator

fun startValueAnimator(from: Float, to: Float, durationMillis: Long = 300, startDelayMillis: Long = 0, interpolator: TimeInterpolator? = null, onUpdate: (Float) -> Unit, onEnd: () -> Unit? = null): ValueAnimator(source)

Creates and immediately starts a float ValueAnimator.

Updates and completion are delivered on the thread that owns the animator, normally the main thread. The caller must cancel the returned animator when its lifecycle ends.

Return

the already-started platform animator

Parameters

from

initial animated value

to

final animated value

durationMillis

animation duration in milliseconds

startDelayMillis

delay before the animation starts

interpolator

optional platform timing interpolator

onUpdate

callback for every platform animation update

onEnd

optional callback invoked when the animator ends