diff --git a/lottie-compose/api/lottie-compose.api b/lottie-compose/api/lottie-compose.api index 03d752ee5b..d9ad2e71d4 100644 --- a/lottie-compose/api/lottie-compose.api +++ b/lottie-compose/api/lottie-compose.api @@ -22,6 +22,7 @@ public final class com/airbnb/lottie/compose/LottieAnimatableKt { public final class com/airbnb/lottie/compose/LottieAnimationKt { public static final fun LottieAnimation (Lcom/airbnb/lottie/LottieComposition;FLandroidx/compose/ui/Modifier;ZZZZLcom/airbnb/lottie/RenderMode;ZLcom/airbnb/lottie/compose/LottieDynamicProperties;Landroidx/compose/ui/Alignment;Landroidx/compose/ui/layout/ContentScale;ZZLcom/airbnb/lottie/AsyncUpdates;Landroidx/compose/runtime/Composer;III)V public static final fun LottieAnimation (Lcom/airbnb/lottie/LottieComposition;Landroidx/compose/ui/Modifier;ZZLcom/airbnb/lottie/compose/LottieClipSpec;FIZZZZLcom/airbnb/lottie/RenderMode;ZZLcom/airbnb/lottie/compose/LottieDynamicProperties;Landroidx/compose/ui/Alignment;Landroidx/compose/ui/layout/ContentScale;ZZLjava/util/Map;ZLcom/airbnb/lottie/AsyncUpdates;Landroidx/compose/runtime/Composer;IIII)V + public static final synthetic fun LottieAnimation (Lcom/airbnb/lottie/LottieComposition;Lkotlin/jvm/functions/Function0;Landroidx/compose/ui/Modifier;ZZZLcom/airbnb/lottie/RenderMode;ZLcom/airbnb/lottie/compose/LottieDynamicProperties;Landroidx/compose/ui/Alignment;Landroidx/compose/ui/layout/ContentScale;ZZLjava/util/Map;Lcom/airbnb/lottie/AsyncUpdates;ZLandroidx/compose/runtime/Composer;III)V public static final fun LottieAnimation (Lcom/airbnb/lottie/LottieComposition;Lkotlin/jvm/functions/Function0;Landroidx/compose/ui/Modifier;ZZZZLcom/airbnb/lottie/RenderMode;ZLcom/airbnb/lottie/compose/LottieDynamicProperties;Landroidx/compose/ui/Alignment;Landroidx/compose/ui/layout/ContentScale;ZZLjava/util/Map;Lcom/airbnb/lottie/AsyncUpdates;ZLandroidx/compose/runtime/Composer;III)V } diff --git a/lottie-compose/src/main/java/com/airbnb/lottie/compose/LottieAnimation.kt b/lottie-compose/src/main/java/com/airbnb/lottie/compose/LottieAnimation.kt index d372b46405..6193f58aed 100644 --- a/lottie-compose/src/main/java/com/airbnb/lottie/compose/LottieAnimation.kt +++ b/lottie-compose/src/main/java/com/airbnb/lottie/compose/LottieAnimation.kt @@ -253,6 +253,55 @@ fun LottieAnimation( ) } +/** + * This is a fallback method for binary compatibility with < 6.6.0 releases. + * + * @see LottieAnimation + */ +@Composable +@Deprecated( + "This is here for binary compatibility. It'll be removed after the next major release", + level = DeprecationLevel.HIDDEN +) +fun LottieAnimation( + composition: LottieComposition?, + progress: () -> Float, + modifier: Modifier = Modifier, + outlineMasksAndMattes: Boolean = false, + applyOpacityToLayers: Boolean = false, + enableMergePaths: Boolean = false, + renderMode: RenderMode = RenderMode.AUTOMATIC, + maintainOriginalImageBounds: Boolean = false, + dynamicProperties: LottieDynamicProperties? = null, + alignment: Alignment = Alignment.Center, + contentScale: ContentScale = ContentScale.Fit, + clipToCompositionBounds: Boolean = true, + clipTextToBoundingBox: Boolean = false, + fontMap: Map? = null, + asyncUpdates: AsyncUpdates = AsyncUpdates.AUTOMATIC, + safeMode: Boolean = false, +) { + LottieAnimation( + composition = composition, + progress = progress, + modifier = modifier, + outlineMasksAndMattes = outlineMasksAndMattes, + applyOpacityToLayers = applyOpacityToLayers, + applyShadowToLayers = false, + enableMergePaths = enableMergePaths, + renderMode = renderMode, + maintainOriginalImageBounds = maintainOriginalImageBounds, + dynamicProperties = dynamicProperties, + alignment = alignment, + contentScale = contentScale, + clipToCompositionBounds = clipToCompositionBounds, + clipTextToBoundingBox = clipTextToBoundingBox, + fontMap = fontMap, + asyncUpdates = asyncUpdates, + safeMode = safeMode, + ) +} + private operator fun Size.times(scale: ScaleFactor): IntSize { return IntSize((width * scale.scaleX).toInt(), (height * scale.scaleY).toInt()) }