react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

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

Open kurtiscc opened this issue 2 years ago • 1 comments

🐛 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

  • React Native Navigation version: 7.26.0
  • React Native version: 0.66.3
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): Any Android device

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?

  • ✖️   Yes, I have the time, and I know how to start.
  • ✅   Yes, I have the time, but I don't know how to start. I would need guidance.
  • ✖️   No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.

kurtiscc avatar Mar 08 '22 19:03 kurtiscc

@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

BlackCat1397 avatar Jan 25 '23 16:01 BlackCat1397