From c23763e6a42ff9a4c4d8d825ee54a6a959c3e752 Mon Sep 17 00:00:00 2001 From: JaesungLeee Date: Thu, 3 Oct 2024 17:47:06 +0900 Subject: [PATCH] =?UTF-8?q?[Feat]=20=ED=99=95=EC=9D=B8=20=ED=81=B4?= =?UTF-8?q?=EB=A6=AD=20=EC=8B=9C=20=EC=95=B1=20=EA=B0=95=EC=A0=9C=EC=A2=85?= =?UTF-8?q?=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../splash/src/main/java/team/ppac/splash/SplashActivity.kt | 5 +++++ .../splash/src/main/java/team/ppac/splash/SplashViewModel.kt | 5 ++--- .../src/main/java/team/ppac/splash/mvi/SplashSideEffect.kt | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/feature/splash/src/main/java/team/ppac/splash/SplashActivity.kt b/feature/splash/src/main/java/team/ppac/splash/SplashActivity.kt index a90251de..17e63d05 100644 --- a/feature/splash/src/main/java/team/ppac/splash/SplashActivity.kt +++ b/feature/splash/src/main/java/team/ppac/splash/SplashActivity.kt @@ -20,6 +20,7 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp import androidx.core.view.WindowCompat import dagger.hilt.android.AndroidEntryPoint +import team.ppac.common.android.extension.forceKillApplication import team.ppac.designsystem.FarmemeTheme import team.ppac.navigator.MainNavigator import team.ppac.splash.mvi.SplashIntent @@ -46,6 +47,10 @@ class SplashActivity : ComponentActivity() { withFinish = true ) } + + SplashSideEffect.ForceFinish -> { + this@SplashActivity.forceKillApplication() + } } } } diff --git a/feature/splash/src/main/java/team/ppac/splash/SplashViewModel.kt b/feature/splash/src/main/java/team/ppac/splash/SplashViewModel.kt index 77b1d2e8..6044e284 100644 --- a/feature/splash/src/main/java/team/ppac/splash/SplashViewModel.kt +++ b/feature/splash/src/main/java/team/ppac/splash/SplashViewModel.kt @@ -49,9 +49,8 @@ class SplashViewModel @Inject constructor( override suspend fun handleIntent(intent: SplashIntent) { when (intent) { SplashIntent.ClickDialogConfirm -> { - reduce { - copy(isNetworkError = false) - } + reduce { copy(isNetworkError = false) } + postSideEffect(SplashSideEffect.ForceFinish) } } } diff --git a/feature/splash/src/main/java/team/ppac/splash/mvi/SplashSideEffect.kt b/feature/splash/src/main/java/team/ppac/splash/mvi/SplashSideEffect.kt index aad6afc6..9a764d86 100644 --- a/feature/splash/src/main/java/team/ppac/splash/mvi/SplashSideEffect.kt +++ b/feature/splash/src/main/java/team/ppac/splash/mvi/SplashSideEffect.kt @@ -4,4 +4,5 @@ import team.ppac.common.android.base.UiSideEffect sealed class SplashSideEffect : UiSideEffect { data object NavigateToMain : SplashSideEffect() + data object ForceFinish : SplashSideEffect() } \ No newline at end of file