keep the Splash screen shown until the redirection to LoginActivity completes

This commit is contained in:
Christophe Beyls 2024-05-03 23:36:59 +02:00
parent 4536db4be0
commit 4b7af31655
1 changed files with 6 additions and 2 deletions

View File

@ -212,11 +212,15 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje
@SuppressLint("RestrictedApi")
override fun onCreate(savedInstanceState: Bundle?) {
installSplashScreen()
val splashScreen = installSplashScreen()
super.onCreate(savedInstanceState)
val activeAccount = accountManager.activeAccount
?: return // will be redirected to LoginActivity by BaseActivity
if (activeAccount == null) {
splashScreen.setKeepOnScreenCondition { true }
// will be redirected to LoginActivity by BaseActivity
return
}
if (supportsOverridingActivityTransitions() && explodeAnimationWasRequested()) {
overrideActivityTransition(OVERRIDE_TRANSITION_OPEN, R.anim.explode, R.anim.activity_open_exit)