Implement dark theme

Try the Compose way
Jetpack Compose is the recommended UI toolkit for Android. Learn how to work with theming in Compose.
Figure 1. Dark theme.

Dark theme is available in Android 10 (API level 29) and higher. It has the following benefits:

  • Reduces power usage by a significant amount, depending on the device’s screen technology.
  • Improves visibility for users with low vision and those who are sensitive to bright light.
  • Makes it easier to use a device in a low-light environment.

Dark theme applies to the Android system UI and apps running on the device.

There are three ways to enable dark theme in Android 10 and higher:

  • Use the system setting by navigating to Settings > Display > Theme to enable dark theme.
  • Use the Quick Settings tile to switch themes from the notification tray, when enabled.
  • On Pixel devices, enable Battery Saver mode to enable dark theme at the same time. Other devices might not support this behavior.

For instructions on applying a dark theme to web-based content using a WebView component, see Darken web content in WebView.

Support dark theme in your app

To support dark theme, set your app's theme—usually found in res/values/styles.xml—to inherit from a DayNight theme: