diff --git a/feature/src/main/java/com/terning/feature/onboarding/splash/NetworkChecker.kt b/feature/src/main/java/com/terning/feature/onboarding/splash/NetworkChecker.kt deleted file mode 100644 index d8ef4937d..000000000 --- a/feature/src/main/java/com/terning/feature/onboarding/splash/NetworkChecker.kt +++ /dev/null @@ -1,20 +0,0 @@ -package com.terning.feature.onboarding.splash - -import android.content.Context -import android.net.ConnectivityManager -import android.net.NetworkCapabilities - -object NetworkManager { - fun checkNetworkState(context: Context): Boolean { - val connectivityManager: ConnectivityManager = - context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager - - val network = connectivityManager.activeNetwork ?: return false - val actNetwork = connectivityManager.getNetworkCapabilities(network) ?: return false - return when { - actNetwork.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR) -> true - actNetwork.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) -> true - else -> false - } - } -} diff --git a/feature/src/main/java/com/terning/feature/onboarding/splash/SplashScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashScreen.kt index efd8c81fb..b839abaf5 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/splash/SplashScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashScreen.kt @@ -39,8 +39,6 @@ fun SplashScreen( val context = LocalContext.current val lifecycleOwner = LocalLifecycleOwner.current - var showDialog = remember { mutableStateOf(false) } - LaunchedEffect(key1 = true) { viewModel.checkConnectedNetwork(context, lifecycleOwner) } @@ -55,7 +53,6 @@ fun SplashScreen( } is SplashState.AlertDialog -> { - showDialog.value = true } } } @@ -63,15 +60,4 @@ fun SplashScreen( TerningImage(painter = R.drawable.ic_splash, modifier = Modifier.fillMaxSize()) - if (showDialog.value) { - SplashDialog( - onDismissRequest = { - showDialog.value = false - }, - content = { - Text(text = "인터넷 연결 확인 바람") - - }, - ) - } } diff --git a/feature/src/main/java/com/terning/feature/onboarding/splash/SplashState.kt b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashState.kt index e1547ffcb..6f099a76a 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/splash/SplashState.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashState.kt @@ -1,7 +1,5 @@ package com.terning.feature.onboarding.splash -import androidx.appcompat.app.AlertDialog - sealed class SplashState { data object AlertDialog : SplashState() data class GetHasAccessToken(val hasAccessToken: Boolean) : SplashState() diff --git a/feature/src/main/java/com/terning/feature/onboarding/splash/SplashViewModel.kt b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashViewModel.kt index 36546e2b4..8bf26c50a 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/splash/SplashViewModel.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashViewModel.kt @@ -26,11 +26,7 @@ class SplashViewModel @Inject constructor( fun checkConnectedNetwork(context: Context, lifecycleOwner: LifecycleOwner) { viewModelScope.launch { - if (NetworkManager.checkNetworkState(context)) { - initSplash(lifecycleOwner) - } else { - _sideEffects.emit(SplashState.AlertDialog) - } + initSplash(lifecycleOwner) } }