The DayNight Solution

Google’s preferred solution is for you to use a theme that adapts based upon whether the device is in dark mode or not. That way, you can have a light theme “normally” while having a dark theme in dark mode.

In particular, AppCompat supports this via its DayNight theme family. The basic recipe is:

You can learn more about the DayNight option in the "Dark Mode" chapter of Elements of Android Q!

Prev Table of Contents Next

This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.