Skip to content

Commit

Permalink
fix: white screen after splash screen (WPB-5439) - cherrypick (#2440)
Browse files Browse the repository at this point in the history
  • Loading branch information
ohassine committed Nov 21, 2023
1 parent 97a8a94 commit 3c5019b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/src/main/kotlin/com/wire/android/ui/WireActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,16 @@ class WireActivity : AppCompatActivity() {

val navigationCommands: MutableSharedFlow<NavigationCommand> = MutableSharedFlow()

// This flag is used to keep the splash screen open until the first screen is drawn.
private var shouldKeepSplashOpen = true

override fun onCreate(savedInstanceState: Bundle?) {
installSplashScreen()
// We need to keep the splash screen open until the first screen is drawn.
// Otherwise a white screen is displayed.
// It's an API limitation, at some point we may need to remove it
installSplashScreen().setKeepOnScreenCondition {
shouldKeepSplashOpen
}
super.onCreate(savedInstanceState)
proximitySensorManager.initialize()
lifecycle.addObserver(currentScreenManager)
Expand All @@ -137,6 +145,7 @@ class WireActivity : AppCompatActivity() {
InitialAppState.LOGGED_IN -> HomeScreenDestination
}
setComposableContent(startDestination) {
shouldKeepSplashOpen = false
handleDeepLink(intent, savedInstanceState)
}
}
Expand Down

0 comments on commit 3c5019b

Please sign in to comment.