createAnimator

abstract fun createAnimator(initialValue: T, targetValue: T, typeConverter: TypeConverter<T>, initialVelocity: AnimationVector? = null): Animator<T>

Creates an Animator configured with the given initial conditions.

The returned animator is a stateless computation engine that can be queried at any elapsed time to produce the animated value, velocity, and completion status.

Return

An Animator that computes values for this animation over time.

Parameters

initialValue

The value at the start of the animation.

targetValue

The value at the end of the animation.

typeConverter

Converts between T and AnimationVector for internal computation.

initialVelocity

A read-only snapshot of the starting per-component velocity in float-space units per second, shaped by typeConverter. Defaults to null (at rest). Non-null values are primarily useful for spring animations during interruption, where the previous animation's per-component velocity carries over for smooth retargeting. Non-spring specs may ignore it.