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" highlight="image resource" />
You can include a BooleanConfiguration element within a Scene element,
as shown in the following code snippet:
<UserConfigurations> <BooleanConfiguration id="show_date" displayName="show_date_label" screenReaderText="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.
highlightAn overlay image that helps to highlight the area of change for this configuration option on the watch face, which may be shown by editors that support it.
The image should have a transparent background, and be tintable. The aspect ratio of the image should match that of the watch face, and the image should also show the boundary of the area affected by the configuration change.
Recommended for you
- Note: link text is displayed when JavaScript is off
- BooleanConfiguration
- Flavor
- Flavor