ismai117 / kottie

Render After Effects Animations Library - Compose Multiplatform | Inspired by Airbnb/Lottie
Apache License 2.0
142 stars 8 forks source link

Preview does not occupy full width #20

Open ArleyPereira opened 5 days ago

ArleyPereira commented 5 days ago

Preview does not occupy full width...

kottie = "1.9.6-alpha02"

@OptIn(ExperimentalResourceApi::class)
@Composable
private fun SplashContent(
    navigateToHomeAuthScreen: () -> Unit
) {
    var animation by remember { mutableStateOf("") }

    LaunchedEffect(Unit) {
        animation = Res.readBytes("files/splash.json").decodeToString()
    }

    val composition = rememberKottieComposition(
        spec = KottieCompositionSpec.File(animation)
    )

    val animationState by animateKottieCompositionAsState(
        composition = composition,
        isPlaying = true
    )

    LaunchedEffect(animationState.isPlaying) {
        if (animationState.isCompleted) {
            navigateToHomeAuthScreen()
        }
    }

    KottieAnimation(
        modifier = Modifier
            .fillMaxSize(),
        composition = composition,
        progress = { animationState.progress }
    )
}

screenshot-1720147214131 Simulator Screenshot - iPhone 15 Pro Max - 2024-07-04 at 23 39 41

ismai117 commented 5 days ago

would you be able to provide the lottie file so I can check it out?

ArleyPereira commented 5 days ago

Can I send it on a private channel

ismai117 commented 5 days ago

@ArleyPereira yeah, you can dm on slack or check social links on my GitHub profile

ArleyPereira commented 22 hours ago

@ismai117 Submitted by LinkedIn