iosMain.kottieComposition.rememberkottieComposition.ios.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kottie Show documentation
Show all versions of kottie Show documentation
Kotlin Multiplatform Animation Library
package kottieComposition
import androidx.compose.runtime.Composable
import kotlinx.cinterop.ExperimentalForeignApi
import lottie.lottieComposition.LottieCompositionSpec
import lottie.lottieComposition.rememberLottieComposition
@OptIn(ExperimentalForeignApi::class)
@Composable
actual fun rememberKottieComposition(
spec: KottieCompositionSpec
): Any? {
return when(spec){
is KottieCompositionSpec.File -> {
(kottieComposition(spec = spec) as? LottieCompositionSpec)?.let {
rememberLottieComposition(it)
}
}
is KottieCompositionSpec.Url -> {
(kottieComposition(spec = spec) as? LottieCompositionSpec)?.let {
rememberLottieComposition(it)
}
}
is KottieCompositionSpec.JsonString -> {
(kottieComposition(spec = spec) as? LottieCompositionSpec)?.let {
rememberLottieComposition(it)
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy