NativeScript / theme

@nativescript/theme
https://v7.docs.nativescript.org/ui/theme
Apache License 2.0
128 stars 45 forks source link

Unable to disable dark theme in Android #257

Closed kvindascr closed 4 years ago

kvindascr commented 4 years ago

Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

Describe the bug I'm unable to disable the Dark mode in android. I'm currently testing with an android 10 emulator with dark mode enabled.

When I enable the dark the mode, Nativescript app always shows up in dark mode.

My app is an angular app and I have tested all recommendations to disable the theme without luck.

I have imported the Theme and do Theme.setTheme(Theme.Light).

I have also added the ns-light class to the page-outlet root element.

Expected behavior

Dark mode should be disabled when following the recommendations.

Steps to Reproduce

Create an Android 10 emulator and enable to dark mode by default. Create a new Angular project. Tns 6.3 / 6.4. Try to disable the dark the mode either by. Import Theme and set themeLight. Set ns-light class on page-outlet.

Neither works.

kvindascr commented 4 years ago

Hello Guys,

I see the issue here.

The theme Light is being applied, but for some reason in android it still displayed as a dark background.

I think probably the Theme Light is missing a default background.

In any case, if I add some specific styles applying to theme light, I can see that the theme light selectors are being applied, but if I do not override the background my app is basically dark.

By the way in version 2.2.x of the @nativescript/theme the Theme.setTheme() is not working correctly.

kvindascr commented 4 years ago

Hello Guys,

I'm closing this one, because I think the issue was being caused by another styles.xml file located in folder values-v29 which had the

<item name="android:forceDarkAllowed">true</item>