diff --git a/app/src/main/java/sopt/uni/presentation/SplashActivity.kt b/app/src/main/java/sopt/uni/presentation/SplashActivity.kt index 3ba2f9f..dcaf9d2 100644 --- a/app/src/main/java/sopt/uni/presentation/SplashActivity.kt +++ b/app/src/main/java/sopt/uni/presentation/SplashActivity.kt @@ -13,6 +13,7 @@ import sopt.uni.R import sopt.uni.data.datasource.local.SparkleStorage import sopt.uni.databinding.ActivitySplashBinding import sopt.uni.presentation.home.HomeActivity +import sopt.uni.presentation.home.UpdateDialogFragment import sopt.uni.presentation.invite.NickNameActivity import sopt.uni.presentation.onboarding.OnBoardingActivity import sopt.uni.util.binding.BindingActivity @@ -46,19 +47,23 @@ class SplashActivity : BindingActivity(R.layout.activity_ } private fun isUpdateAvailable() { - val appUpdateManager = AppUpdateManagerFactory.create(this) - val appUpdateInfoTask = appUpdateManager.appUpdateInfo - appUpdateInfoTask.addOnSuccessListener { appUpdateInfo -> - if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE && appUpdateInfo.isUpdateTypeAllowed( - AppUpdateType.IMMEDIATE, - ) - ) { - SparkleStorage.setUpdateAvailableBoolean(IS_UPDATE_AVAILABLE, true) - Log.e("subin", "${SparkleStorage.getUpdateAvailableBoolean(IS_UPDATE_AVAILABLE)}") - } else { - SparkleStorage.setUpdateAvailableBoolean(IS_UPDATE_AVAILABLE, false) - Log.e("subin", "${SparkleStorage.getUpdateAvailableBoolean(IS_UPDATE_AVAILABLE)}") - } +// val appUpdateManager = AppUpdateManagerFactory.create(this) +// val appUpdateInfoTask = appUpdateManager.appUpdateInfo +// appUpdateInfoTask.addOnSuccessListener { appUpdateInfo -> +// if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE && appUpdateInfo.isUpdateTypeAllowed( +// AppUpdateType.IMMEDIATE, +// ) +// ) { +// SparkleStorage.setUpdateAvailableBoolean(IS_UPDATE_AVAILABLE, true) +// Log.e("subin", "${SparkleStorage.getUpdateAvailableBoolean(IS_UPDATE_AVAILABLE)}") +// } else { +// SparkleStorage.setUpdateAvailableBoolean(IS_UPDATE_AVAILABLE, false) +// Log.e("subin", "${SparkleStorage.getUpdateAvailableBoolean(IS_UPDATE_AVAILABLE)}") +// } +// } + Log.e("hyeon","${SparkleStorage.getUpdateAvailableBoolean(IS_UPDATE_AVAILABLE)}") + if(SparkleStorage.getUpdateAvailableBoolean(IS_UPDATE_AVAILABLE)){ + UpdateDialogFragment().show(supportFragmentManager,"UpdateDialog") } } diff --git a/app/src/main/java/sopt/uni/presentation/home/UpdateDialogFragment.kt b/app/src/main/java/sopt/uni/presentation/home/UpdateDialogFragment.kt index b3fbb75..c26c791 100644 --- a/app/src/main/java/sopt/uni/presentation/home/UpdateDialogFragment.kt +++ b/app/src/main/java/sopt/uni/presentation/home/UpdateDialogFragment.kt @@ -9,14 +9,12 @@ import com.google.android.play.core.appupdate.AppUpdateManagerFactory import com.google.android.play.core.appupdate.AppUpdateOptions import com.google.android.play.core.install.model.AppUpdateType import com.google.android.play.core.install.model.UpdateAvailability -import dagger.hilt.android.AndroidEntryPoint import sopt.uni.R import sopt.uni.data.datasource.local.SparkleStorage import sopt.uni.databinding.TitleAction2DialogBinding import sopt.uni.presentation.BindingDialogFragment import sopt.uni.util.extension.setOnSingleClickListener -@AndroidEntryPoint class UpdateDialogFragment : BindingDialogFragment(R.layout.title_action2_dialog) {