ListConfiguration

通过判断用户当前从表盘选项屏幕中选择的选项,有选择地显示一组文本和图形元素。 此元素会引用表盘文件中其他位置定义的用户配置 ListConfiguration 元素。

此元素在 Wear OS 4 中推出。

语法

<!-- The ID doesn't need to be "handColor"; this is just an example. -->
<UserConfiguration>
    <ListConfiguration id="handColor" />
</UserConfiguration>
<!-- ... -->
<ListConfiguration id="handColor">
    <ListOption id="0">
        <!-- Only the most common element is shown here -->
        <PartText ... />
    </ListOption>
    <!-- Subsequent "ListOption" elements have ID values of 1, 2, ... -->
    <ListOption id="1" ... />
</ListConfiguration>

属性

ListConfiguration 元素有一个必需属性:id。这是一个字符串,必须与之前定义的用户配置 ListConfigurationid 值匹配。

内部元素

ListConfiguration 元素必须包含至少一个 ListOption 内部元素。每个 ListOption 均包含一个 id 值,而且这些 ID 值依序增加(01…)。每个 ListOption 元素都与用户在表盘选项屏幕上看到的选项列表中某一项的从 0 开始位置相对应。

每个 ListOption 内部元素可包含以下元素之一: