Skip to content

Commit

Permalink
[CHORE/#28] update 기능 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
chattymin committed Jan 8, 2024
1 parent 3afef29 commit 7af74b5
Showing 1 changed file with 17 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,30 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(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()
Expand Down

0 comments on commit 7af74b5

Please sign in to comment.