Skip to content
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

The plugin overwrites windowLightNavigationBar theme settings #275

Open
3 tasks done
mohammadrafigh opened this issue Oct 28, 2024 · 0 comments · May be fixed by #276
Open
3 tasks done

The plugin overwrites windowLightNavigationBar theme settings #275

mohammadrafigh opened this issue Oct 28, 2024 · 0 comments · May be fixed by #276

Comments

@mohammadrafigh
Copy link

Bug Report

Problem

What is expected to happen?

Setting <item name="android:windowLightNavigationBar">true</item> should work as expected.

What does actually happen?

It's getting overwritten indirectly by statusbar plugin.

Information

in StatusBar.java in setStatusBarTransparent function when using setSystemUiVisibility the function overwrites windowLightNavigationBar setting which is set in xml theme. The plugin might consider another way to set those flags which doesn't overwrite navigation bar theme or add View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR flag based on the current app theme.

Command or Code

You can try it by adding this theme to themes.xml, here I'm using Splashscreen plugin, but a custom theme could also be defined in config.xml:

<?xml version='1.0' encoding='utf-8'?>
<resources>
    <style name="Theme.App.SplashScreen" parent="Theme.SplashScreen.IconBackground">
        <item name="windowSplashScreenBackground">@color/cdv_splashscreen_background</item>
        <item name="windowSplashScreenAnimatedIcon">@drawable/ic_cdv_splashscreen</item>
        <item name="windowSplashScreenAnimationDuration">200</item>
        <item name="postSplashScreenTheme">@style/MyTheme</item>
    </style>
    <style name="MyTheme" parent="Theme.AppCompat.NoActionBar">
        <item name="android:navigationBarColor">#ffffff</item>
        <item name="android:windowLightNavigationBar">true</item>
    </style>
</resources>

Environment, Platform, Device

Android

Version information

cordova: 12.0.0
cordova-plugin-statusbar: 4.0.0

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant