Closed Kognitivist closed 2 months ago
@OptIn(ExperimentalResourceApi::class) @Composable fun Kottie(resPath: String) { var animation by remember { mutableStateOf("") }
LaunchedEffect(Unit) { animation = Res.readBytes(resPath).decodeToString() } val composition = rememberKottieComposition(spec = KottieCompositionSpec.File(animation)) val animationState by animateKottieCompositionAsState( composition = composition, isPlaying = true, iterations = Int.MAX_VALUE ) KottieAnimation( composition = composition, progress = { animationState.progress }, modifier = Modifier, backgroundColor = Color.Transparent )
}
on android OK
https://github.com/JetBrains/compose-multiplatform/issues/3154
@OptIn(ExperimentalResourceApi::class) @Composable fun Kottie(resPath: String) { var animation by remember { mutableStateOf("") }
}
on android OK