-
Notifications
You must be signed in to change notification settings - Fork 483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StatusBar not changing Color on Android 13 #266
Comments
Thanks for this ! - Did ou also find a way to change the font color |
by using
or
you should be able to set the font color to black/white respectivly, but as mentioned above, on Android 13, this doesn't work. |
Hi, For who is interested by a workaround. I achieve to add a custom statusBar color by defining a new Theme (on a Samsung running Android 13). Since Cordova Android 11, Cordova implements So first, in Cordova
After, you need to define the new theme. You need to create a file and import into your <?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="Theme.Custom" parent="@style/Theme.AppCompat.NoActionBar">
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@color/custom</item>
<item name="android:windowLightStatusBar">false</item>
<item name="android:windowTranslucentStatus">false</item>
</style>
</resources> Pay attention that
Edit: We can still use method Kr. |
Along the same lines as TiBzOu: I achieved a white background status bar with dark text. Tested
|
can you provide a sample app that reproduces the issue? |
@jcesarmobile I'm currently not able to provide a sample app due to lack of enough free time. But I can approve that the reason of this issue is related to the changes on how Splashscreen works as @TiBz0u and @jondspa mentioned above. Splashscreen plugin now starts the main activity of the app with a predefined default theme using <!-- Load our own theme to style navigation bar for API >= 27 -->
<preference name="AndroidPostSplashScreenTheme" value="@style/MyCustomTheme"/>
<!-- Our theme doesn't include anything special for API < 27 -->
<config-file target="res/values/themes.xml" parent="/resources/">
<style name="MyCustomTheme" parent="Theme.AppCompat.NoActionBar"></style>
</config-file>
<!-- Copy our own theme to style navigation bar for API >= 27 -->
<resource-file src="res/theme/android/values-v27/themes.xml" target="app/src/main/res/values-v27/themes.xml" /> then add a <?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyCustomTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:statusBarColor">#002860</item>
</style>
</resources> |
closing since no sample app was provided, but yeah, the problem is the splash screen not allowing changes to the status bar while it's being animated. |
Same issue |
worked for me on android14 |
Bug Report
Problem
What is expected to happen?
In the callback of "deviceready" when executing backgroundColorByHexString, StatusBar should change color.
What does actually happen?
StatusBar doesn't change color.
Information
This only happens on Android 13. On Android 12 and lower, everything works as expected.
I debugged the issue using Android Studio and saw that the relevant functions get executed without error. Note that when setting a break point, everything works. Without a break point however, it doesn't.
I also found out that setting a timeout of about 2 seconds fixes the issue but is not a great solution.
Command or Code
in 'config.xml':
Environment, Platform, Device, Versions
Platform: Android 13
Device: Pixel 7a
Cordova-Android: 12.0.1
Cordova-CLI: 12
Checklist
The text was updated successfully, but these errors were encountered: