主题
TextThemeStyle 继承自: Enum
当前主题中预定义的 Material 文本样式角色。
将这些值用于 theme_style 等属性,来引用语义化的排版槽位(display、headline、title、body、label),而不是在每个控件里硬编码字体度量。
枚举值
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
DISPLAY_LARGE | — | 'displayLarge' | Largest display style. Intended for very prominent, short text on large surfaces, such as hero headlines. |
DISPLAY_MEDIUM | — | 'displayMedium' | Medium display style. Intended for high-impact short text when DISPLAY_LARGE is too dominant. |
DISPLAY_SMALL | — | 'displaySmall' | Smallest display style. Intended for concise, emphasized text that still needs display-level prominence. |
HEADLINE_LARGE | — | 'headlineLarge' | Largest headline style. Headline styles are below display styles and suit short, high-emphasis headings. |
HEADLINE_MEDIUM | — | 'headlineMedium' | Medium headline style. Suitable for section headers and prominent in-content headings. |
HEADLINE_SMALL | — | 'headlineSmall' | Smallest headline style. Suitable for compact headline usage on dense layouts. |
TITLE_LARGE | — | 'titleLarge' | Largest title style. Titles are typically used for medium-emphasis, short text such as card titles. |
TITLE_MEDIUM | — | 'titleMedium' | Medium title style. Suitable for secondary titles and emphasized labels in structured content. |
TITLE_SMALL | — | 'titleSmall' | Smallest title style. Suitable for compact title text where space is limited. |
LABEL_LARGE | — | 'labelLarge' | Largest label style. Commonly used for component text, such as button labels and prominent captions. |
LABEL_MEDIUM | — | 'labelMedium' | Medium label style. Suitable for compact UI labels in controls and supporting interface text. |
LABEL_SMALL | — | 'labelSmall' | Smallest label style. Suitable for dense, low-footprint labels and small supporting annotations. |
BODY_LARGE | — | 'bodyLarge' | Largest body style. Body styles are intended for longer passages and primary reading content. |
BODY_MEDIUM | — | 'bodyMedium' | Medium body style. Common default style for standard paragraph text in Material-themed UIs. |
BODY_SMALL | — | 'bodySmall' | Smallest body style. Suitable for secondary body text, footnotes, and compact long-form content. |