Lottie Animatable
LottieAnimatable is an extension of LottieAnimationState that contains imperative suspend functions to control animation playback.
To create one, call:
val animatable = rememberLottieAnimatable()
This is the imperative version of animateLottieCompositionAsState.
LottieAnimationState ensures mutual exclusiveness on its animations. To achieve this, when a new animation is started via animate or snapTo, any ongoing animation will be canceled via a CancellationException. Because of this, it is possible that your animation will not start synchronously. As a result, if you switch from animating one composition to another, it is not safe to render the second composition immediately after calling animate. Instead, you should always rely on LottieAnimationState.composition and LottieAnimationState.progress.
This class is comparable to androidx.compose.animation.core.Animatable. It is a relatively low-level API that gives maximum control over animations. In most cases, you can use animateLottieCompositionAsState which provides declarative APIs to create, update, and animate a LottieComposition.