-
public final class Mdc3Theme
-
-
Method Summary
Modifier and Type Method Description final static UnitMdc3Theme(Context context, Boolean readColorScheme, Boolean readTypography, Boolean readShapes, Boolean setTextColors, Boolean setDefaultFontFamily, Function0<Unit> content)A MaterialTheme which reads the corresponding values from a Material Components for Android theme in the given context. final static Theme3ParameterscreateMdc3Theme(Context context, LayoutDirection layoutDirection, Density density, Boolean readColorScheme, Boolean readTypography, Boolean readShapes, Boolean setTextColors, Boolean setDefaultFontFamily)This function creates the components of a androidx.compose.material. -
-
Method Detail
-
Mdc3Theme
final static Unit Mdc3Theme(Context context, Boolean readColorScheme, Boolean readTypography, Boolean readShapes, Boolean setTextColors, Boolean setDefaultFontFamily, Function0<Unit> content)
A MaterialTheme which reads the corresponding values from a Material Components for Android theme in the given context.
By default the text colors from any associated
TextAppearances from the theme are not read. This is because setting a fixed color in the resulting TextStyle breaks the usage of androidx.compose.material.ContentAlpha through androidx.compose.material.LocalContentAlpha. You can customize this through the setTextColors parameter.- Parameters:
context- The context to read the theme from.readColorScheme- whether the read the MDC color palette from the context's theme.readTypography- whether the read the MDC text appearances from context's theme.readShapes- whether the read the MDC shape appearances from the context's theme.setTextColors- whether to read the colors from theTextAppearances associated from the theme.setDefaultFontFamily- whether to read and prioritize thefontFamilyattributes from context's theme, over any specified in the MDC text appearances.
-
createMdc3Theme
final static Theme3Parameters createMdc3Theme(Context context, LayoutDirection layoutDirection, Density density, Boolean readColorScheme, Boolean readTypography, Boolean readShapes, Boolean setTextColors, Boolean setDefaultFontFamily)
This function creates the components of a androidx.compose.material.MaterialTheme, reading the values from an Material Components for Android theme.
By default the text colors from any associated
TextAppearances from the theme are not read. This is because setting a fixed color in the resulting TextStyle breaks the usage of androidx.compose.material.ContentAlpha through androidx.compose.material.LocalContentAlpha. You can customize this through the setTextColors parameter.For Shapes, the layoutDirection is taken into account when reading corner sizes of
ShapeAppearances from the theme. For example, Shapes.medium.topStart will be read fromcornerSizeTopLeftfor LayoutDirection.Ltr andcornerSizeTopRightfor LayoutDirection.Rtl.The individual components of the returned Theme3Parameters may be
null, depending on the matching 'read' parameter. For example, if you set readColorScheme tofalse, Theme3Parameters.colors will be null.- Parameters:
context- The context to read the theme from.layoutDirection- The layout direction to be used when reading shapes.density- The current density.readColorScheme- whether the read the MDC color palette from the context's theme.readTypography- whether the read the MDC text appearances from context's theme.readShapes- whether the read the MDC shape appearances from the context's theme.setTextColors- whether to read the colors from theTextAppearances associated from the theme.setDefaultFontFamily- whether to read and prioritize thefontFamilyattributes from context's theme, over any specified in the MDC text appearances.
-
-
-
-