raggedycoder
raggedycoder

Reputation: 495

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.

Upvotes: 6

Views: 4377

Answers (2)

Fabian
Fabian

Reputation: 978

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

Upvotes: 2

Er. Rakesh Prajapat
Er. Rakesh Prajapat

Reputation: 241

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

Upvotes: 2

Related Questions