Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#101 [hotfix] : 스플래시 무한 로딩 오류 fix #102

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import androidx.lifecycle.flowWithLifecycle
import com.airbnb.lottie.LottieComposition
import com.airbnb.lottie.compose.LottieAnimation
import com.airbnb.lottie.compose.LottieCompositionSpec
import com.airbnb.lottie.compose.LottieConstants
import com.airbnb.lottie.compose.animateLottieCompositionAsState
import com.airbnb.lottie.compose.rememberLottieComposition
import com.teamwable.designsystem.theme.WableTheme
import com.teamwable.main_compose.R
Expand All @@ -30,10 +28,6 @@ fun SplashRoute(
) {
val lifecycleOwner = LocalLifecycleOwner.current
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.wable_splash))
val progress by animateLottieCompositionAsState(
composition = composition,
iterations = LottieConstants.IterateForever,
)

LaunchedEffect(Unit) {
delay(2000)
Expand All @@ -52,21 +46,18 @@ fun SplashRoute(

WableSplashScreen(
composition = composition,
progress = progress,
)
}

@Composable
fun WableSplashScreen(
composition: LottieComposition?,
progress: Float,
) {
Box(
modifier = Modifier.fillMaxSize(),
) {
LottieAnimation(
composition = composition,
progress = { progress },
modifier = Modifier.align(Alignment.Center),
)
}
Expand All @@ -78,7 +69,6 @@ fun GreetingPreview() {
WableTheme {
WableSplashScreen(
composition = rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.wable_splash)).value,
progress = 1.0f,
)
}
}