Introducing night mode in an Android app

I want to add night mode to an android app. In this case, I added the layout-night folder to the res folder. Now I want that if my user selects the night mode theme from the settings, the application will use the layout from the night-layout folder.

Can anyone give me any suggestion on how to implement it from the coding part.

+5
source share
2 answers

NightOwl creates its own implementation for the individual attributes of the day and day. https://github.com/ashqal/NightOwl

+2
source

Use the UI MODE Manager in the Android app to set the night mode in the app. For more information, follow this link. http://developer.android.com/reference/android/app/UiModeManager.html

+1
source

Source: https://habr.com/ru/post/1239053/


All Articles