From fece92e15ad07da1791c08d62f138f327c818f8f Mon Sep 17 00:00:00 2001 From: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> Date: Mon, 19 Jul 2021 02:20:19 +0700 Subject: [PATCH] Fix transparent system bars after MainActivity recreated (#5574) --- app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index 031d89fc2a..8b8919d07b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -288,7 +288,7 @@ class MainActivity : BaseViewBindingActivity() { ViewCompat.requestApplyInsets(binding.root) } - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S && splashScreen != null) { val oldStatusColor = window.statusBarColor val oldNavigationColor = window.navigationBarColor window.statusBarColor = Color.TRANSPARENT @@ -300,7 +300,7 @@ class MainActivity : BaseViewBindingActivity() { wicc.isAppearanceLightStatusBars = false wicc.isAppearanceLightNavigationBars = false - splashScreen?.setOnExitAnimationListener { splashProvider -> + splashScreen.setOnExitAnimationListener { splashProvider -> // For some reason the SplashScreen applies (incorrect) Y translation to the iconView splashProvider.iconView.translationY = 0F