BooleanConfiguration

A Boolean Configuration gives the user an option that can be turned on or off when customizing the watch face in the watch face editor.

Introduced in Wear OS 4.

Syntax

<BooleanConfiguration id="string" displayName="string" icon="string"
                         screenReaderText="string" defaultValue="TRUE | FALSE"
/>

You can include a BooleanConfiguration element within a Scene element, as shown in the following code snippet:

<UserConfigurations>
  <BooleanConfiguration id="show_date"
      displayName="@string/show_date_label"
      screenReaderText="@string/show_date_label"
      defaultValue="TRUE"
  />
</UserConfigurations>

<!-- ... -->

<Scene backgroundColor="#ff000000">
  <!-- ... -->

  <BooleanConfiguration id="show_date">
    <BooleanOption id="TRUE">
      <Group ...>
        <!-- ...Content to show date -->
      </Group>
    </BooleanOption>
    <BooleanOption id="FALSE">
      <Group ...>
        <!-- ...Content when date not required -->
      </Group>
    </BooleanOption>
  </BooleanConfiguration>

  <!-- ... -->
</Scene>

Attributes

The BooleanConfiguration element has the following attributes:

Required attributes

The following attributes are required:

id
A unique identifier for the configuration value.
displayName
A resource ID corresponding to the text that is displayed in the watch face editor.
defaultValue
The default configuration value used if the user does not explicitly change the configuration in the watch face editor.

Optional attributes

The following attributes are optional:

icon
A resource ID corresponding to the drawable resource which is shown in the watch face editor. This should have a maximum size of 400x400 px.
screenReaderText
A resource ID corresponding to the text which is used if the user has TalkBack enabled.