Mobile development

Stage 2 · Lesson 10 of 10

Material 3 components and theming

Jetpack Compose UI

in gives you ready-made components styled by MaterialTheme, such as Scaffold, TopAppBar, Button, Card and NavigationBar. A new project creates a Theme.kt file with a light and a dark ColorScheme, a Typography and Shapes.

isSystemInDarkTheme() picks the scheme. On Android 12 and later, can build the palette from the user's wallpaper. Components read MaterialTheme.colorScheme.surface or MaterialTheme.typography.titleMedium instead of fixed values.

So dark mode and a rebrand change one file. The Material Theme Builder creates schemes from a brand colour.

Common trapColor.White and 18.sp literals in every , which break in dark mode.

A question to check yourself, an AI practice session and 2 cheat sheet entries come with the full roadmap. Unlock

Resources for this stage

Start with

Practise

  • Use a free challenge's mobile design image as the spec for a native screen

Keep handy

  • Spacing, type scale, colour and component specs your screens should follow

Mark this stage as not done?