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

Theme.getMode() returns 'ns-light' while device is in dark mode (ios and android) #232

Open
nickolanack opened this issue Nov 21, 2019 · 12 comments
Assignees

Comments

@nickolanack
Copy link

nickolanack commented Nov 21, 2019

before setting the theme, ( using .setMode(...) or .toggleMode())
I would expect .getMode() to return 'ns-dark' if the device (system appearance) was in dark mode however .getMode() initially always returns 'ns-light'

Im not totally sure if this is a bug - I'm now just using application.systemAppearance() instead but thought that I would post this issue just in case.
"nativescript-theme-core": "^2.0.24",

✔ Component nativescript has 6.2.1 version and is up to date.
✔ Component tns-core-modules has 6.2.1 version and is up to date.
✔ Component tns-android has 6.2.0 version and is up to date.
✔ Component tns-ios has 6.2.0 version and is up to date.

@bundyo
Copy link
Contributor

bundyo commented Nov 26, 2019

More like an enhancement, as this functionality wasn't updated after {N} 6.2 got released.

@bundyo bundyo self-assigned this Nov 26, 2019
@DevPlus31
Copy link

Same issue getting ns-light instead of ns-dark

@rushairer
Copy link

Same issue
but always getting ns-dark

@bundyo
Copy link
Contributor

bundyo commented Jan 13, 2020

With the @next version (2.3.0+) getMode should now return Theme.Auto ("auto"), after which you can call application.systemAppearance() to get the system mode. Can you try it out?

Also @next introduces hard mode setting - setting a mode will override the system mode until you call Theme.setMode(Theme.Auto).

@bundyo bundyo closed this as completed Feb 14, 2020
@erjdriver
Copy link

I'm using 2.3.3 and this feature is not working!

getMode() returns ns-light.

not sure why these issues are being closed without being fixed.

@bundyo
Copy link
Contributor

bundyo commented Mar 29, 2020

The hard mode change is not yet merged, there were some objections against it from the team. I'll re-discuss it with them tomorrow.

@bundyo bundyo reopened this Mar 29, 2020
@erjdriver
Copy link

Also, when the app is open and then you go to phone settings to change the system theme (the NS app goes to background) - and then re-open the NS app - the new change is not reflected.

I do receive the callback in the app that a new theme has been selected - but the page is not refreshed with the new theme.

Is this something I have to do - and if so how can I call it from the callback - w/ no reference to the current displayed page.

Thanks.

@bundyo
Copy link
Contributor

bundyo commented Mar 30, 2020

Can you provide a Playground demo what exactly are you doing? Thanks in advance.

@erjdriver
Copy link

The phone is in dark mode.

I open the nativescript app - and it's in dark mode.

I do a theme.getMode() and it returns ns-light.

That's the bug!

@bundyo
Copy link
Contributor

bundyo commented May 30, 2020

Can you check if this works with the latest @next version?

@dev-buildableworks
Copy link

This is issue is still current on the latest version of native script (tns version 6.7.8)

@iamabs2001
Copy link

everything is fine just disable force dark mode in App Resource and disable always night mode from developer options.

Screenshot_20210106-194519.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants