Reputation: 1032
I've read this article: https://medium.com/@chrisbanes/appcompat-v23-2-daynight-d10f90c83e94. It mentions DayNight theme and then:
Then you need to enable the feature in your app. You do that by calling AppCompatDelegate.setDefaultNightMode() which takes one of four values:
- MODE_NIGHT_NO. Always use the day (light) theme.
- MODE_NIGHT_YES. Always use the night (dark) theme.
- MODE_NIGHT_AUTO. Changes between day/night based on the time of day.
- MODE_NIGHT_FOLLOW_SYSTEM (default). This setting follows the system’s setting, which is essentially MODE_NIGHT_NO at the time of writing
Scenario is simple: The app toggles the night mode automatically without in-app settings.
Upvotes: 4
Views: 1866
Reputation: 2014
I think the good answer is:
Advantage of
MODE_NIGHT_NO, MODE_NIGHT_YES, MODE_NIGHT_AUTO
will always ignore user/device settings. You can set nigthmode enable in your app while nigthmode is totally disabled by user on device.
Advantage of
MODE_NIGHT_FOLLOW_SYSTEM
can be equivalent to MODE_NIGHT_NO, MODE_NIGHT_YES, MODE_NIGHT_AUTO, the user choice for all apps by the user on the device.
Upvotes: 0