All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.kottieComposition.rememberkottieComposition.desktop.kt Maven / Gradle / Ivy

There is a newer version: 1.9.6
Show newest version
package kottieComposition

import skiaComposition.SkiaCompositionSpec
import androidx.compose.runtime.Composable
import skiaComposition.rememberSkiaComposition


@Composable
actual fun rememberKottieComposition(
    spec: KottieCompositionSpec
): Any? {
    return when(spec){
        is KottieCompositionSpec.File -> {
            (kottieComposition(spec = spec) as? SkiaCompositionSpec)?.let {
                rememberSkiaComposition(it)
            }
        }
        is KottieCompositionSpec.Url -> {
            (kottieComposition(spec = spec) as? SkiaCompositionSpec)?.let {
                rememberSkiaComposition(it)
            }
        }
        is KottieCompositionSpec.JsonString -> {
            (kottieComposition(spec = spec) as? SkiaCompositionSpec)?.let {
                rememberSkiaComposition(it)
            }
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy