A guide to implementing dark theme support in Android apps using AppCompat's DayNight functionality. Covers theme setup by extending Theme.AppCompat.DayNight, the available night mode options (MODE_NIGHT_NO, MODE_NIGHT_YES, MODE_NIGHT_FOLLOW_SYSTEM, MODE_NIGHT_AUTO_BATTERY), how to check the current configuration, WebView caveats, system night mode on Android Pie+, recommended in-app settings for users, and how to use night/notnight resource qualifiers for custom dark/light resources.
Table of contents
How do I use it? #setLocalNightMode() #How can I check what configuration I’m currently in? #WebViews #System night mode #In-app setting #Updating your themes + styles #Using your own resources for dark/light #2 Impressions