You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Theme.getMode() returns 'ns-light' while device is in dark mode (ios and android) #232
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.
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).
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.
Activity
bundyo commentedon Nov 26, 2019
More like an enhancement, as this functionality wasn't updated after {N} 6.2 got released.
DevPlus31 commentedon Nov 30, 2019
Same issue getting ns-light instead of ns-dark
rushairer commentedon Dec 13, 2019
Same issue
but always getting ns-dark
bundyo commentedon 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).erjdriver commentedon Mar 28, 2020
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 commentedon 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.
erjdriver commentedon Mar 29, 2020
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 commentedon Mar 30, 2020
Can you provide a Playground demo what exactly are you doing? Thanks in advance.
erjdriver commentedon May 24, 2020
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 commentedon May 30, 2020
Can you check if this works with the latest @next version?
dev-buildableworks commentedon Jul 22, 2020
This is issue is still current on the latest version of native script (tns version 6.7.8)
iamabs2001 commentedon Jan 6, 2021
everything is fine just disable force dark mode in App Resource and disable always night mode from developer options.