kadiraydinli / react-native-system-navigation-bar

React Native lets you customize the navigation bar for Android.
https://www.npmjs.com/package/react-native-system-navigation-bar
MIT License
270 stars 19 forks source link

Dark navigation bar doesn't work #26

Closed Sondago closed 1 year ago

Sondago commented 2 years ago

Hi, i recently installed your library and when i want to "setNavigationColor" with "light bar" on true, buttons doesn't color in "black". I'm on react native v0.69. Can you help me please ?

kadiraydinli commented 2 years ago

Hi, what is the brand, model and Android version of the device you are using?

Sondago commented 2 years ago

I'm using an OnePlus 7 on Android 11 but i tried on some other devices and i got the same problem

kadiraydinli commented 2 years ago

@Sondago Can you check again with the latest version? If the problem persists, can you share sample code?

Profex1999 commented 2 years ago

@kadiraydinli I'm having this issue too. I'm using both an Emulator with API level 29 and my own physical samsung S20+ (API level 31) . In API level 30 setSystemUiVisibility and all related constants are deprecated in favor of WindowInsetsController. I ran some tests and using this snippet it works, but I still can't understand why it does not with the old method. Maybe the bit masking is not correct ?

if (light) {
  getWindow.getDecorView()
     .getWindowInsetsController()
     .setSystemBarsAppearance(WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS,
           WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS
   );

} else {
   getWindow.getDecorView().getWindowInsetsController().setSystemBarsAppearance(0,
           WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS
   );
}
Sondago commented 2 years ago

@kadiraydinli for me it's fixed thanks you very much !

kadiraydinli commented 1 year ago

I made changes for this issue, you can find it in the latest version.