yogaboy
11/06/2022, 3:12 PMsindrenm
11/06/2022, 3:36 PMyogaboy
11/06/2022, 3:40 PMMR3Y
11/06/2022, 3:58 PMyogaboy
11/06/2022, 6:18 PMprivate fun animSplashScreen(splashScr: SplashScreen) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
splashScr.setOnExitAnimationListener { splashScreenView ->
val animator: ViewPropertyAnimator =
splashScreenView.iconView.animate().alpha(0f).setDuration(1000L)
.setInterpolator(LinearInterpolator())
animator.withEndAction { splashScreenView.remove() }
animator.start()
}
}
}
And for the first app start this peace of code broke the StatusBar invisibility. If I switch to DM or LM than is again OK. Do you have a Idea what will break it?MR3Y
11/06/2022, 6:49 PMSplashScreen
API on Android 12+ but, I guess this is happening because Android is using the theme defined in themes.xml
during Application startup. so, the solution to this is simple: just update the theme that your app is using by default in themes.xml
file to match that theme in your compose code.
Also, from a quick research, I found that SplashScreen
API has a method called setSplashScreenTheme()
, this I think an easier way to override the theme your splash screen is using (as it by default uses the one declared in themes.xml
as I said)yogaboy
11/06/2022, 7:15 PMyogaboy
11/06/2022, 7:17 PMMR3Y
11/06/2022, 7:20 PMyogaboy
11/06/2022, 8:11 PM<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">true</item>
Thank you so much! Now it looks nice and cool M3 😄 🤩MR3Y
11/06/2022, 8:37 PMyogaboy
11/06/2022, 8:38 PM