Binary compatibility with 6.5 and lower on LottieAnimation (#2591)
diff --git a/lottie-compose/api/lottie-compose.api b/lottie-compose/api/lottie-compose.api
index 03d752e..d9ad2e7 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/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 d372b46..6193f58 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 @@
)
}
+/**
+ * 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<String, Typeface>? = 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())
}