Wear Material 主题
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。

Wear Material 主题能够系统地自定义 Wear Material Design 以反映您的品牌特色。当您开始更改界面的各个方面(例如颜色和排版)时,Wear Material 主题工具会让您的设计构想体现在整个用户体验中。借助这些工具,您可以为所有可自定义的属性提供特定值,从而在设计工作流和代码工作流之间轻松切换。自定义属性值可为您的产品创建一个 Wear Material 主题。
使用 Wear Material 主题
Wear Material 主题包含三项主要操作:自定义主题、在所有设计模拟中应用该主题、在代码中使用该主题。
Wear Material Design 随附可按原样使用的内置主题。您可以对内置主题进行自定义,使 Material 适合您的产品。
主题的实际应用
主题能够影响您的整个界面,包括条状标签等单个组件。以下示例展示了如何自定义条状标签组件的默认值。
所含条状标签已被分配了特定颜色、形状和字类的值。请调整默认值,使其适合您的应用的样式。

之前
采用默认样式的基准 Wear Material 条状标签。
|
之后
自定义的 Wear Material 条状标签。
|
颜色
颜色系统支持为组件、文本、图标和界面设置自定义颜色。您可以为以下 13 个类别设置主题颜色:

Primary
Primary 变体
Secondary
Secondary 变体
背景
Surface
错误
On Primary
On Secondary
On Background
On Surface
On Surface 变体
On Error
排版
排版系统支持 11 个类别,这些类别共同形成字体比例。这种字体比例决定了屏幕上显示的各种字体样式和字号,从正文到按钮文字都包括在内。
排版属性通过可针对字类、字体、大小写、字号和字间距进行自定义的值来控制。

本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Wear Material Theming is the ability to systematically customize Wear Material\nDesign to reflect your brand. When you begin changing aspects of your UI such\nas color and typography, Wear Material Theming tools apply your design vision\nthroughout your user experience. The tools allow easy switching between\ndesign and code workflows by providing specific values for all customizable\nattributes. Customizing the attribute values creates a Wear Material Theme for\nyour product.\n\nUse Wear Material Theming\n-------------------------\n\nWear Material Theming consists of three main actions: customizing your theme,\napplying it across your design mocks, and using it in code.\n\nWear Material Design comes with a built-in theme that can be used as is.\nCustomize the built-in theme to make Material work for your product.\n\n### Theming in practice\n\nTheming affects your entire UI, including individual components such as chips.\nThe following example shows how to customize a chip component's default values.\n\nA contained chip is assigned values for a specific color, shape, and type\nfamily. Adjust the default values to suit your app's style.\n\n|---------------------------------------------------------------|--------------------------------------------|\n| **Before** A baseline Wear Material chip with default styles. | **After** A customized Wear Material chip. |\n\nColor\n-----\n\nThe color system supports setting custom colors for components, text, icons, and\nsurfaces. Set your theme colors for the 13 following categories:\n\n1. Primary\n\n2. Primary Variant\n\n3. Secondary\n\n4. Secondary Variant\n\n5. Background\n\n6. Surface\n\n7. Error\n\n8. On Primary\n\n9. On Secondary\n\n10. On Background\n\n11. On Surface\n\n12. On Surface Variant\n\n13. On Error\n\nTypography\n----------\n\nThe typography system supports 11 categories that together form the type scale.\nThis type scale determines the various type styles and sizes that appear\non-screen, ranging from body copy to button text.\n\nTypography attributes are controlled by values that can be customized for the\ntype family, font, case, size, and tracking."]]