pierresh commented on issue #1501: URL: https://github.com/apache/cordova-android/issues/1501#issuecomment-1521037083
> The key here seems to be the `postSplashScreenTheme` as very loosely documented by Android: https://developer.android.com/reference/kotlin/androidx/core/splashscreen/SplashScreen. This feature is supported by the splashscreen behaviour in `cordova-android` core: #1441 > > With Android 12+, this theme doesn't apply until the splash screen is fully hidden, and when it _does_ apply it will clobber any settings configured by the Statusbar plugin while the splash was displayed. > > In my case, I've added a `styles.xml` file with the configuration my app was setting Statusbar to, and this resolved the issue. > > ``` > <?xml version="1.0" encoding="utf-8"?> > <resources> > <style name="AppTheme" parent="@style/Theme.AppCompat.Light.NoActionBar"> > <item name="android:windowBackground">@color/windowBackground</item> > <item name="android:statusBarColor">@android:color/white</item> > <item name="android:windowLightStatusBar">true</item> > </style> > </resources> > ``` > > Added to the `config.xml` like this: > > ``` > <widget ...> > <platform name="android"> > <preference name="AndroidPostSplashScreenTheme" value="@style/AppTheme" /> > <resource-file src="res/android/styles.xml" target="app/src/main/res/values/styles.xml" /> > </platform> > </widget> > ``` Thanks a lot for your solution, it helped me and it worked. I just changed 2 things: - I removed `<item name="android:windowBackground">@color/windowBackground</item>` because that line made the build failed - I change the color from **@android:color/white** to **@android:color/transparent** so I am still able to change color below the status bar (I use `overlaysWebView(true)`), so that it works in every condition, including dark mode -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
