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

Public methods

Effect<ColorPalette>

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

Effect<Shapes>

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

Effect<Typography>

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

Public methods

colors

fun colors(): Effect<ColorPalette>

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

import androidx.ui.foundation.ColoredRect

val colors = +MaterialTheme.colors()
ColoredRect(color = colors.primary)

shapes

fun shapes(): Effect<Shapes>

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

typography

fun typography(): Effect<Typography>

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

import androidx.ui.core.Text

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