diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d4716f7d..bd86b5d5 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -10,8 +10,8 @@ android { defaultConfig { applicationId = "com.withpeace.withpeace" targetSdk = 34 - versionCode = 6 - versionName = "1.0.1" + versionCode = 7 + versionName = "1.0.2" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { diff --git a/app/src/main/java/com/withpeace/withpeace/MainActivity.kt b/app/src/main/java/com/withpeace/withpeace/MainActivity.kt index 8b31f4a8..da55c3d3 100644 --- a/app/src/main/java/com/withpeace/withpeace/MainActivity.kt +++ b/app/src/main/java/com/withpeace/withpeace/MainActivity.kt @@ -53,7 +53,6 @@ class MainActivity : ComponentActivity() { super.onCreate(savedInstanceState) // System Bar에 가려지는 뷰 영역을 개발자가 제어하겠다. WindowCompat.setDecorFitsSystemWindows(window, false) - lifecycleScope.launch { splashScreen = installSplashScreen() splashScreen.setKeepOnScreenCondition { true } @@ -63,9 +62,7 @@ class MainActivity : ComponentActivity() { when (uiState) { MainUiState.Home -> composeStart(HOME_ROUTE) MainUiState.Login -> composeStart(LOGIN_ROUTE) - MainUiState.Update -> { - compulsionUpdate() - } + MainUiState.Update -> {} MainUiState.Error -> finish() MainUiState.Loading -> {} diff --git a/app/src/main/java/com/withpeace/withpeace/MainViewModel.kt b/app/src/main/java/com/withpeace/withpeace/MainViewModel.kt index 680d78f1..c2e06ba1 100644 --- a/app/src/main/java/com/withpeace/withpeace/MainViewModel.kt +++ b/app/src/main/java/com/withpeace/withpeace/MainViewModel.kt @@ -6,7 +6,11 @@ import com.withpeace.withpeace.core.domain.usecase.CheckAppUpdateUseCase import com.withpeace.withpeace.core.domain.usecase.IsLoginUseCase import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.channels.Channel +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.receiveAsFlow +import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import javax.inject.Inject @@ -15,8 +19,8 @@ class MainViewModel @Inject constructor( private val isLoginUseCase: IsLoginUseCase, private val checkAppUpdateUseCase: CheckAppUpdateUseCase, ) : ViewModel() { - private val _uiState: Channel = Channel() - val uiState = _uiState.receiveAsFlow() + private val _uiState: MutableStateFlow = MutableStateFlow(MainUiState.Loading) + val uiState = _uiState.asStateFlow() init { checkUpdate() @@ -27,18 +31,18 @@ class MainViewModel @Inject constructor( checkAppUpdateUseCase( currentVersion = BuildConfig.VERSION_CODE, onError = { - _uiState.send(MainUiState.Error) + _uiState.update { MainUiState.Error } }, ).collect { shouldUpdate -> if (shouldUpdate) { - _uiState.send(MainUiState.Update) + _uiState.update {MainUiState.Update } return@collect } val isLogin = isLoginUseCase() if (isLogin) { - _uiState.send(MainUiState.Home) + _uiState.update { MainUiState.Home } } else { - _uiState.send(MainUiState.Login) + _uiState.update { MainUiState.Login } } } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0f75bf5f..0ed740bb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,17 +1,16 @@ [versions] androidGradlePlugin = "8.2.2" -androidDesugarJdkLibs = "1.2.2" androidxCore = "1.12.0" androidxAppCompat = "1.6.1" androidxLifecycle = "2.7.0" -androidxComposeBom = "2023.10.01" +androidxComposeBom = "2024.06.00" androidxComposeCompiler = "1.5.1" -androidxComposeNavigation = "2.7.6" +androidxComposeNavigation = "2.7.7" composeIconExtended = "1.5.4" androidxActivity = "1.8.2" coreSplashscreen = "1.0.1" -hilt = "2.48" -hiltNavigationCompose = "1.1.0" +hilt = "2.51.1" +hiltNavigationCompose = "1.2.0" androidxConstraintlayout = "1.0.1" lifecycleRuntimeKtx = "2.7.0" @@ -54,15 +53,15 @@ androidxGlance = "1.0.0-beta01" glanceExperimentalTools = "0.2.2" junit = "1.1.5" material = "1.12.0" -material3Android = "1.3.0-beta03" -material3 = "1.3.0-beta03" +material3Android = "1.3.0-beta04" +material3 = "1.3.0-beta04" multidex = "2.0.1" google-login = "1.1.0" credential = "1.2.0" -paging = "3.3.0-alpha02" +paging = "3.3.0" coreTesting = "2.2.0" dependencyGraph = "0.8.0" @@ -77,7 +76,6 @@ benchmarkMacroJunit4 = "1.2.0-beta01" [libraries] android-gradlePlugin = { group = "com.android.tools.build", name = "gradle", version.ref = "androidGradlePlugin" } -android-desugarJdkLibs = { group = "com.android.tools", name = "desugar_jdk_libs", version.ref = "androidDesugarJdkLibs" } kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } hilt-gradlePlugin = { module = "com.google.dagger:hilt-android-gradle-plugin", version.ref = "hilt" }