Implementing Dark Mode on Android — part two

Lessons learned from a single Activity, multi-flavored, dynamically themed Application

Photo by Steve Harvey on Unsplash

Problems ahead!

Configuration change

Having multiple flavors

Changing theme dynamically

Supporting API versions less than 29

AppCompatDelegate.MODE_NIGHT_NO
AppCompatDelegate.MODE_NIGHT_YES
AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
// AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY

The major quirk

Problems I haven’t been able to fix

Lead Developer at Qvik, Coach, Agile Thinker, GDG Lead.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store