Member-only story
Android Material Theming in Jetpack Compose
Easily customize application-wide theming using Compose

Jetpack Compose is Android’s UI toolkit of the future. It is currently in beta. If you haven't gone through my previous article, please check out my Introduction to Jetpack Compose. It gives the basic idea behind and usage of Jetpack Compose.
In this article, we will learn how to implement theming using Jetpack Compose. Jetpack Compose theming has different APIs that provide flexibility to style our app. With the help of Material Theming, we can provide a consistent look for our app.
In the traditional approach of building UI through XML, we used themes.xml
to design and apply themes to elements where required. But with Jetpack, we do everything at the class level using different APIs.
Let’s see how to customize colors, typography, and shapes so that they are used consistently throughout our application. Themes in Jetpack Compose are based on Material Design. It is much easier to set custom themes with only a few lines of code.
Material Theme
A Material Theme defines the styling principles from the Material Design specification. In Jetpack Compose, MaterialTheme
is available as a composable function with which we can customize the default…