Closed PartypayNL closed 2 years ago
@PartypayNL Included RN StatusBar
component does not use AndroidX
. You have to use https://github.com/zoontek/react-native-bars instead.
Everything will work once this fix will be released: https://github.com/facebook/react-native/commit/50c8e973f067d4ef1fc3c2eddd360a0709828968
As you can see in the commit message:
Apparently, once you call
setSystemBarsAppearance
Android will no longer respectsystemUiVisibility
and if anyone, such as the Android 12 Splash Screen library, happens to call it, it will break status bars.
Which is done by the AndroidX Splash screen module: https://github.com/androidx/androidx/blob/androidx-main/core/core-splashscreen/src/main/java/androidx/core/splashscreen/ThemeUtils.kt#L43
Until then, react-native-bars
works correctly.
@zoontek i applied the patch to my current RN version which is 0.67.4 but it didn't fix the issue any suggestions other than installing react-native-bars for this ! i don't like the idea of adding a dependency to achieve functionality which is supported out of the box 🤔
Everything will work once this fix will be released: facebook/react-native@50c8e97
As you can see in the commit message:
Apparently, once you call
setSystemBarsAppearance
Android will no longer respectsystemUiVisibility
and if anyone, such as the Android 12 Splash Screen library, happens to call it, it will break status bars.Which is done by the AndroidX Splash screen module: https://github.com/androidx/androidx/blob/androidx-main/core/core-splashscreen/src/main/java/androidx/core/splashscreen/ThemeUtils.kt#L43
Until then,
react-native-bars
works correctly.
@zoontek do you mind reopening this issue? I'm facing this very same problem in a project using react-native 0.69.1
@gabrieldonadel With 4.2.3?
@gabrieldonadel With 4.2.3?
Thanks for the quick response @zoontek, but unfortunately yes, I'm experiencing this in a project using "react-native-bootsplash": "^4.2.3"
and "react-native": "0.69.1"
.
As soon as my splash screen gets hidden the StatusBar text becomes white
@gabrieldonadel With 4.2.3?
Thanks for the quick response @zoontek, but unfortunately yes, I'm experiencing this in a project using
"react-native-bootsplash": "^4.2.3"
and"react-native": "0.69.1"
.As soon as my splash screen gets hidden the StatusBar text becomes white
Screen.Recording.2022-07-01.at.15.36.42.mov
Can you publish your styles.xml files?
@gabrieldonadel With 4.2.3?
Thanks for the quick response @zoontek, but unfortunately yes, I'm experiencing this in a project using
"react-native-bootsplash": "^4.2.3"
and"react-native": "0.69.1"
. As soon as my splash screen gets hidden the StatusBar text becomes white Screen.Recording.2022-07-01.at.15.36.42.movCan you publish your styles.xml files?
Sure, here is the styles.xml
file
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
<item name="android:textColor">#000000</item>
<!-- Added to prevent an issue when using underlineColorAndroid property on TextInput
See https://github.com/facebook/react-native/issues/17530 for more information -->
<item name="android:editTextBackground">@android:color/transparent</item>
</style>
<style name="BootTheme" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/bootsplash_background</item>
<item name="windowSplashScreenAnimatedIcon">@mipmap/bootsplash_logo</item>
<item name="postSplashScreenTheme">@style/AppTheme</item>
</style>
</resources>
and here is the colors.xml
file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="blue">#2fb2fd</color>
<color name="white">#ffffff</color>
<color name="black">#191D24</color>
<color name="colorAccent">#2FB2FD</color>
<color name="bootsplash_background">#FFFFFF</color>
</resources>
@gabrieldonadel As you don't seem to set the initial status bar style in your XML, I assume you did it in JS, on the first screen (StatusBar, dark-content)?
Could you create a small repository with a fresh project so I can debug it?
Bug summary
Implementing react-native-bootsplash broke the barStyle prop from the Statusbar component. Other props like backgroundColor seem to be working fine. Uninstalling react-native-bootsplash fixes this issue.
https://reactnative.dev/docs/statusbar
Library version
4.1.0
Environment info
Steps to reproduce
Reproducible sample code