6

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.

0

2 Answers 2

2

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

2

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

1
  • It's not set automatically? We have to set it manually? What if I want to provide resources based on it for the splash screen? This one is called before any code of the app... Commented Jun 29, 2019 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.