Skip to content

Commit

Permalink
Merge pull request #102 from Team-Wable/hotfix/#101-splash-infilnite-…
Browse files Browse the repository at this point in the history
…error

#101 [hotfix] : 스플래시 무한 로딩 오류 fix
  • Loading branch information
chanubc authored Oct 14, 2024
2 parents a2f3037 + 7c65233 commit b8525eb
Showing 1 changed file with 0 additions and 10 deletions.
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,
)
}
}

0 comments on commit b8525eb

Please sign in to comment.