11package com.threegap.bitnagil.presentation.splash
22
3+ import androidx.compose.animation.core.tween
4+ import androidx.compose.animation.fadeIn
5+ import androidx.compose.foundation.background
6+ import androidx.compose.foundation.layout.Arrangement
37import androidx.compose.foundation.layout.Box
8+ import androidx.compose.foundation.layout.Column
49import androidx.compose.foundation.layout.fillMaxSize
5- import androidx.compose.material3.Text
10+ import androidx.compose.foundation.layout.padding
11+ import androidx.compose.foundation.layout.size
612import androidx.compose.runtime.Composable
13+ import androidx.compose.runtime.getValue
14+ import androidx.compose.runtime.mutableStateOf
15+ import androidx.compose.runtime.remember
16+ import androidx.compose.runtime.setValue
717import androidx.compose.ui.Alignment
818import androidx.compose.ui.Modifier
919import androidx.compose.ui.tooling.preview.Preview
20+ import androidx.compose.ui.unit.dp
1021import androidx.hilt.navigation.compose.hiltViewModel
22+ import com.threegap.bitnagil.designsystem.BitnagilTheme
23+ import com.threegap.bitnagil.designsystem.R
24+ import com.threegap.bitnagil.designsystem.component.atom.BitnagilIcon
25+ import com.threegap.bitnagil.presentation.splash.component.template.BitnagilLottieAnimation
1126import com.threegap.bitnagil.presentation.splash.model.SplashSideEffect
1227import org.orbitmvi.orbit.compose.collectSideEffect
1328
@@ -24,26 +39,56 @@ fun SplashScreenContainer(
2439 }
2540 }
2641
27- SplashScreen ()
42+ SplashScreen (
43+ onCompleted = viewModel::onAnimationCompleted,
44+ )
2845}
2946
3047@Composable
3148private fun SplashScreen (
49+ onCompleted : () -> Unit ,
3250 modifier : Modifier = Modifier ,
3351) {
34- Box (
35- modifier = modifier.fillMaxSize(),
52+ var showIcon by remember { mutableStateOf(false ) }
53+
54+ Column (
55+ modifier = modifier
56+ .fillMaxSize()
57+ .background(BitnagilTheme .colors.white),
58+ verticalArrangement = Arrangement .Center ,
59+ horizontalAlignment = Alignment .CenterHorizontally
3660 ) {
37- Text (
38- text = " 야무진 로고 추가 예정" ,
39- modifier = Modifier
40- .align(Alignment .Center ),
41- )
61+ Box (
62+ contentAlignment = Alignment .Center
63+ ) {
64+ BitnagilLottieAnimation (
65+ lottieJson = R .raw.splash_lottie,
66+ onComplete = onCompleted,
67+ onStart = {
68+ showIcon = true
69+ },
70+ maxFrame = 120 ,
71+ modifier = Modifier
72+ .padding(bottom = 36 .dp)
73+ .size(204 .dp)
74+ .align(Alignment .BottomCenter ),
75+ )
76+
77+ androidx.compose.animation.AnimatedVisibility (
78+ visible = showIcon,
79+ enter = fadeIn(animationSpec = tween(500 )),
80+ modifier = Modifier .align(Alignment .BottomCenter )
81+ ) {
82+ BitnagilIcon (id = R .drawable.img_app_name)
83+ }
84+ }
4285 }
4386}
4487
4588@Preview(showBackground = true )
4689@Composable
4790private fun SplashScreenPreview () {
48- SplashScreen ()
91+ SplashScreen (
92+ onCompleted = {},
93+ )
4994}
0 commit comments