CHANGELOG_COMPOSE.md
@JvmOverloads to LottieAnimation to improve binary compatibility (#2320)() -> Float rather than a Float. This allows Lottie to redraw without triggering a recomposition every time progress updates. For more information, refer to the Compose phase docs. The existing API will exist as deprecated for one more release but will then be removed. For the vast majority of use cases:LottieAnimation(composition, progress)
will become:
LottieAnimation(composition, { progress })
or
LottieAnimation(
composition = composition,
progress = { progress }
)
clipToCompositionBounds to false.LottieProperty.TEXT and the existing dynamic property APIs (#1995)fillMaxSize() (#1892)LottieAnimation now takes a progress float instead of driving the animation internally.
The driving of animations has been split into a new LottieAnimatable class and
animateLottieCompositionAsState function. These are analogous to Jetpack's Animatable and
animate*AsState functions.
Properties that pertain to the animation such as speed, repeat count, and the new clip spec are part of
animateLottieComposition whereas properties that are related to rendering such as enabling merge paths
and setting an image asset delegate are on the LottieAnimation composable.
lottieComposition has also been renamed rememberLottieComposition.
There are overloaded version of LottieAnimation that merge the properties for convenience. Please
refer to the docs for LottieAnimation, LottieAnimatable, animateLottieCompositionAsState
and rememberLottieComposition for more information.
composition.images["your_image_id"].bitmap = yourBitmap. This lets you control
exactly how and when the bitmaps get created and set. The previous implementation of calling a callback on every
frame encouraged the incorrect behavior of doing IO tasks during the animation hot path. Check out ImagesExamplesPage.kt
for usage.