wix / react-native-navigation

A complete native navigation solution for React Native
https://wix.github.io/react-native-navigation/
MIT License
13.04k stars 2.67k forks source link

Android: OS-Level Theme Changes Not Updating Status Bar or Bottom Tabs Properly #7475

Open kurtiscc opened 2 years ago

kurtiscc commented 2 years ago

🐛 Bug Report

Everything was working until PR#7178 and release 7.19.0 where there were several Theme changes made. Whenever you change the theme (dark/light) at the OS level and then resume your application, the status bar will be the opposite theme of what the current OS theme is. Noticed the same issue once you started navigating around on the bottom tabs.

Have you read the Contributing Guidelines on issues?

Yes.

To Reproduce

  1. Launch your application
  2. Put your app in the background
  3. Go to the Settings on your Android device.
  4. Go to Appearance/Theme
  5. Change the theme from dark --> light or light --> dark
  6. Resume your application and see the bug

Expected behavior

The status bar should update based on the theme selected.

Actual Behavior

The status bar updates to the opposite of what it should be.

Your Environment

Reproducible Demo

Since this is easily reproducible by simply downgrading your RNN version to 7.18.1 and seeing it work properly, then upgrading to 7.19.0+ and seeing it broken, that should be demo enough.

I am not positive why this is working, but simply removing line 56 in NavigationActivity.java fixes the issue. My application does not need to worry about landscape vs portrait configuration changes since its portrait only.

    @Override
    public void onConfigurationChanged(@NonNull Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        getReactGateway().onConfigurationChanged(this, newConfig);
        // navigator.onConfigurationChanged(newConfig); // <-- remove this line
    }

Are you willing to resolve this issue by submitting a Pull Request?

BlackCat1397 commented 1 year ago

@kurtiscc

I'm facing a bit different issue, but probably it's related. You can check if change from the PR resolves your issue. https://github.com/wix/react-native-navigation/pull/7675