Google is committed to advancing racial equity for Black communities. See how.

MaterialTheme

object MaterialTheme
kotlin.Any
   ↳ androidx.ui.material.MaterialTheme

Contains functions to access the current theme values provided at the call site's position in the hierarchy.

Summary

Properties
ColorPalette

Retrieves the current ColorPalette at the call site's position in the hierarchy.

Shapes

Retrieves the current Shapes at the call site's position in the hierarchy.

Typography

Retrieves the current Typography at the call site's position in the hierarchy.

Properties

colors

@Composable val colors: ColorPalette

Retrieves the current ColorPalette at the call site's position in the hierarchy.

import androidx.ui.foundation.Box
import androidx.ui.foundation.drawBackground
import androidx.ui.layout.aspectRatio
import androidx.ui.layout.fillMaxSize

val colors = MaterialTheme.colors
Box(Modifier.aspectRatio(1f).fillMaxSize().drawBackground(colors.primary))

shapes

@Composable val shapes: Shapes

Retrieves the current Shapes at the call site's position in the hierarchy.

typography

@Composable val typography: Typography

Retrieves the current Typography at the call site's position in the hierarchy.

import androidx.ui.foundation.Text

val typography = MaterialTheme.typography
Text(text = "H4 styled text", style = typography.h4)