Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implement Night Mode on android app

I want to add a night mode on my android app. For this case I added a folder layout-night in the res folder. Now I want that if my user choose the night mode theme from the settings, the app will use the layout from the layout-night folder.

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

like image 336
raggedycoder Avatar asked Dec 23 '15 13:12

raggedycoder


2 Answers

NightOwl has build its own implementation for separate night and day attributes. https://github.com/ashqal/NightOwl

like image 64
Fabian Avatar answered Oct 21 '22 23:10

Fabian


Use UI MODE Manager in android application to set night mode in application. for more details follow this link. http://developer.android.com/reference/android/app/UiModeManager.html

like image 2
Er. Rakesh Prajapat Avatar answered Oct 21 '22 23:10

Er. Rakesh Prajapat