From 954b6fce8d3941b46b242b0e671fe51d7687faee Mon Sep 17 00:00:00 2001 From: tgyuu-An Date: Wed, 3 Apr 2024 16:23:01 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[FEATURE]=20#166=20:=20splash=20Animation?= =?UTF-8?q?=20=EB=B3=B5=EA=B5=AC=20!!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/deploymentTargetDropDown.xml | 15 +-- .../wap/wapp/feature/splash/SplahScreen.kt | 106 +++++++++++++++++- .../wapp/feature/splash/SplashViewModel.kt | 20 +++- 3 files changed, 120 insertions(+), 21 deletions(-) diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml index 22160448..2f0367c4 100644 --- a/.idea/deploymentTargetDropDown.xml +++ b/.idea/deploymentTargetDropDown.xml @@ -3,20 +3,7 @@ - - - - - - - - - - - - - - + diff --git a/feature/splash/src/main/java/com/wap/wapp/feature/splash/SplahScreen.kt b/feature/splash/src/main/java/com/wap/wapp/feature/splash/SplahScreen.kt index fb2c6ab0..d280601a 100644 --- a/feature/splash/src/main/java/com/wap/wapp/feature/splash/SplahScreen.kt +++ b/feature/splash/src/main/java/com/wap/wapp/feature/splash/SplahScreen.kt @@ -1,23 +1,39 @@ package com.wap.wapp.feature.splash import android.widget.Toast +import androidx.compose.animation.AnimatedContent +import androidx.compose.animation.core.animateDpAsState +import androidx.compose.animation.core.tween +import androidx.compose.animation.scaleIn +import androidx.compose.animation.scaleOut +import androidx.compose.animation.togetherWith import androidx.compose.foundation.Image import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size +import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp import androidx.hilt.navigation.compose.hiltViewModel +import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.wap.designsystem.WappTheme import com.wap.wapp.core.commmon.extensions.TrackScreenViewEvent import com.wap.wapp.core.commmon.extensions.toSupportingText +import com.wap.wapp.core.designresource.R.drawable import com.wap.wapp.feature.splash.R.string @Composable @@ -27,6 +43,8 @@ internal fun SplashRoute( navigateToNotice: () -> Unit, ) { val context = LocalContext.current + val isIconLogoVisible by viewModel.isIconLogoVisible.collectAsStateWithLifecycle() + val isIconLogoGoUp by viewModel.isIconLogoGoUp.collectAsStateWithLifecycle() LaunchedEffect(true) { viewModel.splashUiEvent.collect { event -> @@ -42,24 +60,102 @@ internal fun SplashRoute( } } - SplashScreen() + SplashScreen( + isIconLogoVisible = isIconLogoVisible, + isIconLogoGoUp = isIconLogoGoUp, + ) } @Composable -internal fun SplashScreen() { +internal fun SplashScreen( + isIconLogoVisible: Boolean, + isIconLogoGoUp: Boolean, +) { + val ANIMATION_MILLS = 400 + TrackScreenViewEvent(screenName = "SplashScreen") - Box( + Column( modifier = Modifier .fillMaxSize() .background(WappTheme.colors.backgroundBlack), + ) { + AnimatedContent( + targetState = isIconLogoVisible, + transitionSpec = { + scaleIn(tween(ANIMATION_MILLS, ANIMATION_MILLS)) togetherWith + scaleOut(tween(ANIMATION_MILLS)) + }, + ) { isIconLogoVisible -> + if (!isIconLogoVisible) { + SplashTypoLogo() + } else { + SplashIconLogo(isIconLogoGoUp) + } + } + } +} + +@Composable +private fun SplashTypoLogo() { + Column( + verticalArrangement = Arrangement.Center, + modifier = Modifier + .fillMaxSize(), ) { Image( painter = painterResource(id = R.drawable.ic_wapp_logo), modifier = Modifier - .align(Alignment.Center) + .align(Alignment.CenterHorizontally) .size(width = 230.dp, height = 230.dp), contentDescription = stringResource(id = string.wapp_icon_description), ) } } + +@Composable +private fun SplashIconLogo(isIconLogoGoUp: Boolean) { + val animatedPadding by animateDpAsState( + targetValue = if (isIconLogoGoUp) 200.dp else 0.dp, + animationSpec = tween(1000), + ) + + Column(modifier = Modifier.fillMaxSize()) { + Column( + verticalArrangement = Arrangement.Center, + modifier = Modifier + .fillMaxSize() + .weight(1f) + .padding(bottom = animatedPadding), + ) { + Image( + painter = painterResource(id = drawable.img_white_cat), + modifier = Modifier + .align(Alignment.CenterHorizontally) + .size(width = 230.dp, height = 230.dp), + contentDescription = stringResource(id = string.wapp_icon_description), + ) + + Row( + modifier = Modifier.align(Alignment.CenterHorizontally), + ) { + Column { + Spacer(modifier = Modifier.height(40.dp)) + + Text( + text = stringResource(id = string.application_name), + style = WappTheme.typography.titleBold, + fontSize = 48.sp, + color = WappTheme.colors.white, + ) + } + Text( + text = stringResource(id = string.application_name), + fontSize = 48.sp, + style = WappTheme.typography.titleBold, + color = WappTheme.colors.yellow34, + ) + } + } + } +} diff --git a/feature/splash/src/main/java/com/wap/wapp/feature/splash/SplashViewModel.kt b/feature/splash/src/main/java/com/wap/wapp/feature/splash/SplashViewModel.kt index 1ccba97d..1f98e6e0 100644 --- a/feature/splash/src/main/java/com/wap/wapp/feature/splash/SplashViewModel.kt +++ b/feature/splash/src/main/java/com/wap/wapp/feature/splash/SplashViewModel.kt @@ -4,8 +4,11 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.wap.wapp.core.domain.usecase.auth.IsUserSignInUseCase import dagger.hilt.android.lifecycle.HiltViewModel +import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableSharedFlow +import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asSharedFlow +import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.launch import javax.inject.Inject @@ -16,16 +19,29 @@ class SplashViewModel @Inject constructor( private val _splashUiEvent = MutableSharedFlow() val splashUiEvent = _splashUiEvent.asSharedFlow() + private var _isIconLogoVisible = MutableStateFlow(false) + var isIconLogoVisible = _isIconLogoVisible.asStateFlow() + + private var _isIconLogoGoUp = MutableStateFlow(false) + var isIconLogoGoUp = _isIconLogoGoUp.asStateFlow() + init { - isUserSignIn() + viewModelScope.launch { + delay(1000) + _isIconLogoVisible.value = true + delay(1000) + isUserSignIn() + } } - private fun isUserSignIn() = viewModelScope.launch { + private suspend fun isUserSignIn() { isUserSignInUseCase() .onSuccess { isSignIn -> if (isSignIn) { _splashUiEvent.emit(SplashEvent.SignInUser) } else { + _isIconLogoGoUp.value = true + delay(1000) _splashUiEvent.emit(SplashEvent.NonSignInUser) } }.onFailure { throwable -> From e6614365bc4bcbd3a427c92eee85804aac49c0cc Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Wed, 10 Apr 2024 14:58:08 +0900 Subject: [PATCH 2/2] [CHORE] : App Version Update --- .../intermediates/ktLint/reporterProviders.bin | Bin 166 -> 0 bytes core/build/intermediates/ktLint/reporters.bin | Bin 299 -> 0 bytes gradle/libs.versions.toml | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 core/build/intermediates/ktLint/reporterProviders.bin delete mode 100644 core/build/intermediates/ktLint/reporters.bin diff --git a/core/build/intermediates/ktLint/reporterProviders.bin b/core/build/intermediates/ktLint/reporterProviders.bin deleted file mode 100644 index 11e8bd367a13ffa979b7037a8ccdfea515ca9c7b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 166 zcmZ4UmVvdnh(S0ju`E%qv?Mb}&#|Z|vC=2AxTK=-lI+amiF2757(E$SiZiQHD+(AG z7#Pc0KqOF;WpaM5UO{GFNorAQafx1bNe+;$SCm?iUj!7=E67RA%+m`1kwH+gfTH}e z%#_rk?M&ymt$O62GchpwFfe7NlrRYSfLx%TlbDyTA6!zDnU`)|QBcCb3O1wy0EU=3 A1ONa4 diff --git a/core/build/intermediates/ktLint/reporters.bin b/core/build/intermediates/ktLint/reporters.bin deleted file mode 100644 index d5a0d6164241e4b971c1185f7ae04a9c3b51f888..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 299 zcmX|6J5B>J5S?T<4G2X7i3ZV8drOK`DN;ljAxJ@O?V8PGjqQvl#Gydq7!=%qd!(St zJ-7nG=GRQ|=6&BjU=Rq77V1HX6{8VjBDIkiI6m)AU$*MCfZi0!fR8$Q0O+mDe3R(H zQ7ab4Xyj1OS98&lYK#^g8?-Fejyg?3I@R20?}#;p+k}m4MrY45uKz#D681ljulrC) zIJiTjCy})ciOFy%bG^za+g39swCza39{rk5nce5ZS_ntS2PjtR~FXgTe5Pkdtnsa7> diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b3ff0eac..9515ff59 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,8 +2,8 @@ compileSdk = "34" minSdk = "26" targetSdk = "34" -versionName = "1.0.0" -versionCode = "1" +versionName = "1.0.2" +versionCode = "3" gradleplugin = "8.1.2"