# Dark Theme with MDC

DevFeed: [Dark Theme with MDC](<https://devfeed.tech/articles/dark-theme-with-mdc-24922.md>)

Original publisher: [Read original article](<https://medium.com/androiddevelopers/dark-theme-with-mdc-4c6fc357d956?source=rss-9303277cb6db------2>)

Author: Chris Banes

Published: 2020-08-25T22:01:01Z

Content type: tutorial

Language: en

Sources: [Chris Banes on Medium](<https://devfeed.tech/sources/chris-banes-on-medium.md>)

Topics: [Dark Mode](<https://devfeed.tech/topics/dark-mode.md>), [Android](<https://devfeed.tech/topics/android.md>), [Material Design](<https://devfeed.tech/topics/material-design.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [design](<https://devfeed.tech/tags/design.md>), [implement](<https://devfeed.tech/tags/implement.md>), [mad-skills](<https://devfeed.tech/tags/mad-skills.md>), [material-components](<https://devfeed.tech/tags/material-components.md>), [material-design](<https://devfeed.tech/tags/material-design.md>), [quick-start](<https://devfeed.tech/tags/quick-start.md>)

## AI overview

A tutorial on implementing dark themes in Android apps with Material Design Components. It explains the platform's device-wide dark-theme setting, the design and battery considerations, and the initial steps for extending an app theme with Theme.MaterialComponents.DayNight and optionally allowing users to choose the theme mode.

## Source excerpt

Using Material Design Components to implement a dark theme In the previous blog posts, Nick Rout went through the basis of Material Theming, and the pillars of color, typography and shape. Material Theming with MDC: Color Material Theming with MDC: Type Material Theming with MDC: Shape This post is going to build upon that to see how we can adapt our apps to support dark themes. User selectable dark themes were added to the Android platform in Android 10, but that does not mean they're new to app developers. The default theme for Android devices was dark up until Android 5.0 (Lollipop)! The difference last year was that the platform added a device-wide setting. Meaning that the user has additional control over the theme of the device, but also of apps. Alongside the recent device-wide setting, we now also have comprehensive design guidance on material.io, which we will talk about later in this blog post. Why support dark theme? First up, why support a dark theme at all? The Material.io page on Dark Theme has a good summary on some of the technical benefits (emphasis mine): Dark themes reduce the luminance emitted by device screens [...]. They help improve visual ergonomics by reducing eye strain, adjusting brightness to current lighting conditions, and facilitating screen use in dark environments -- all while conserving battery power [for OLED displays]. The most important reason though is that your users want it. The Android team added the system-wide dark theme setting because it consistently came up as a top requested feature by users. Now that I've convinced you to support dark themes in your app, let's look at how you add one... Quick start To add a dark theme to your app, use Material Design Components (MDC) for Android's support: #1: Change your theme You need to change your theme to extend from one of the Theme.MaterialComponents.DayNight themes: <style name="Theme.MyApp" parent="Theme.MaterialComponents.DayNight"> <!-- Other theme attributes --></style>#2: Choos