From 7af74b52874a14fca7c7deca88397a1a2a00f560 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Mon, 8 Jan 2024 20:03:31 +0900 Subject: [PATCH] =?UTF-8?q?[CHORE/#28]=20update=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/splash/SplashActivity.kt | 45 +++++++------------ 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/presentation/src/main/java/com/going/presentation/splash/SplashActivity.kt b/presentation/src/main/java/com/going/presentation/splash/SplashActivity.kt index d4aa9d20..a904766a 100644 --- a/presentation/src/main/java/com/going/presentation/splash/SplashActivity.kt +++ b/presentation/src/main/java/com/going/presentation/splash/SplashActivity.kt @@ -25,41 +25,30 @@ class SplashActivity : BaseActivity(R.layout.activity_spl override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - initAppUpdate() + isConnectedNetwork() } - private fun initAppUpdate() { + private fun isConnectedNetwork() { if (NetworkManager.checkNetworkState(this)) { - if (BuildConfig.DEBUG) { - initSplash() - } else { - val appUpdateInfoTask = appUpdateManager.appUpdateInfo - appUpdateInfoTask.addOnSuccessListener { appUpdateInfo -> - if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE) { - appUpdateInfo.isUpdateTypeAllowed(IMMEDIATE) - requestUpdate(appUpdateInfo) - } else { - initSplash() - } - }.addOnFailureListener { - initSplash() - } - } + initSplash() } else { - AlertDialog.Builder(this) - .setTitle(R.string.notice) - .setMessage(R.string.internet_connect_error) - .setCancelable(false) - .setPositiveButton( - R.string.okay, - ) { _, _ -> - finishAffinity() - } - .create() - .show() + showNetworkErrorAlertDialog() } } + private fun showNetworkErrorAlertDialog() = + AlertDialog.Builder(this) + .setTitle(R.string.notice) + .setMessage(R.string.internet_connect_error) + .setCancelable(false) + .setPositiveButton( + R.string.okay, + ) { _, _ -> + finishAffinity() + } + .create() + .show() + private fun initSplash() { Handler(Looper.getMainLooper()).postDelayed({ navigateToSignInScreen()