MaterialTheme
object MaterialTheme
Contains functions to access the current theme values provided at the call site's position in the hierarchy.
Summary
Public properties |
|
---|---|
Colors |
Retrieves the current |
Shapes |
Retrieves the current |
Typography |
Retrieves the current |
Public properties
colors
val colors: Colors
Retrieves the current Colors
at the call site's position in the hierarchy.
import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.aspectRatio import androidx.compose.foundation.layout.fillMaxSize val colors = MaterialTheme.colors Box(Modifier.aspectRatio(1f).fillMaxSize().background(color = colors.primary))
shapes
val shapes: Shapes
Retrieves the current Shapes
at the call site's position in the hierarchy.
typography
val typography: Typography
Retrieves the current Typography
at the call site's position in the hierarchy.
import androidx.compose.material.Text val typography = MaterialTheme.typography Text(text = "H4 styled text", style = typography.h4)