使用氛围模式要求节省电量
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
所有表盘都应不仅具有互动模式,还具有氛围模式。Wear OS 应用质量指南规定,在氛围模式下,只有 15% 的像素会亮起。
通常,手表会在氛围模式下花费更多时间,在此期间,节省电量是首要任务。
设计良好的氛围模式显示屏仅包含必要信息,并尽可能减少亮起的像素数量。
如需实现在氛围模式和互动模式之间更改外观的组件,建议的方法是添加两个元素,每个元素都包含 Variant
。在 Part*
或 Group
级别添加此项后,可以尽可能减少 Variant
元素的数量。
<Group name="logo_interactive" ... alpha="255">
<!-- Hide these elements in ambient mode -->
<Variant mode="AMBIENT" target="alpha" value="0" />
<!-- Components to show in interactive mode -->
</Group>
<Group name="logo_ambient" ... alpha="0">
<Variant mode="AMBIENT" target="alpha" value="255" />
<!-- Components to show in ambient mode -->
</Group>
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Save power using ambient mode requirements\n\nAll watch faces should have not only an interactive mode, but also ambient mode.\nThe Wear OS App Quality guidelines specify that only [15% of pixels are\nilluminated in ambient mode](/docs/quality-guidelines/wear-app-quality#wff).\n\nTypically, the watch spends much more time in ambient mode, and during this\ntime, conserving power is a priority.\n\nWell designed ambient displays contain only essential information, and they\nminimize the number of pixels that are illuminated.\n\nThe recommended approach for implementing a component that alters in appearance\nbetween ambient and interactive modes is to add two elements, each with a\n`Variant`. Adding this at the `Part*` or `Group` level makes it possible keep\nthe number of `Variant` elements to a minimum. \n\n \u003cGroup name=\"logo_interactive\" ... alpha=\"255\"\u003e\n \u003c!-- Hide these elements in ambient mode --\u003e\n \u003cVariant mode=\"AMBIENT\" target=\"alpha\" value=\"0\" /\u003e\n \u003c!-- Components to show in interactive mode --\u003e\n \u003c/Group\u003e\n \u003cGroup name=\"logo_ambient\" ... alpha=\"0\"\u003e\n \u003cVariant mode=\"AMBIENT\" target=\"alpha\" value=\"255\" /\u003e\n \u003c!-- Components to show in ambient mode --\u003e\n \u003c/Group\u003e"]]