Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-05-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-20 UTC."],[],[],null,["# BooleanConfiguration\n\nWatch Face Format version Version 4 Version 3 Version 2 Version 1\n\n*** ** * ** ***\n\nA Boolean Configuration gives the user an option that can be turned on or off\nwhen customizing the watch face in the watch face editor.\n\nIntroduced in Wear OS 4.\n\nSyntax\n------\n\n```xml\n\u003cBooleanConfiguration id=\"string\" displayName=\"string\" icon=\"string\"\n screenReaderText=\"string\" defaultValue=\"TRUE | FALSE\"\n/\u003e\n```\n\nYou can include a `BooleanConfiguration` element within a `Scene` element,\nas shown in the following code snippet: \n\n```xml\n\u003cUserConfigurations\u003e\n \u003cBooleanConfiguration id=\"show_date\"\n displayName=\"show_date_label\"\n screenReaderText=\"show_date_label\"\n defaultValue=\"TRUE\"\n /\u003e\n\u003c/UserConfigurations\u003e\n\n\u003c!-- ... --\u003e\n\n\u003cScene backgroundColor=\"#ff000000\"\u003e\n \u003c!-- ... --\u003e\n\n \u003cBooleanConfiguration id=\"show_date\"\u003e\n \u003cBooleanOption id=\"TRUE\"\u003e\n \u003cGroup ...\u003e\n \u003c!-- ...Content to show date --\u003e\n \u003c/Group\u003e\n \u003c/BooleanOption\u003e\n \u003cBooleanOption id=\"FALSE\"\u003e\n \u003cGroup ...\u003e\n \u003c!-- ...Content when date not required --\u003e\n \u003c/Group\u003e\n \u003c/BooleanOption\u003e\n \u003c/BooleanConfiguration\u003e\n\n \u003c!-- ... --\u003e\n\u003c/Scene\u003e\n```\n| **Note:** `BooleanConfiguration` elements cannot be nested within a `Scene` when attempting to select content based on the value of two or more configuration options combined. For using configuration options in conjunction with other values, use [`Condition`](/training/wearables/wff/common/condition) instead. For example: \n|\n| ```xml\n| \u003cCondition\u003e\n| \u003cExpressions\u003e\n| \u003cExpression name=\"show_date_and_time\"\u003e\n| \u003c![CDATA[[CONFIGURATION.show_date] == \"TRUE\" && [CONFIGURATION.show_time] == \"TRUE\"]]\u003e\n| \u003c/Expression\u003e\n| \u003c/Expressions\u003e\n| ...\n| \u003c/Condition\u003e\n| ```\n\nAttributes\n----------\n\nThe `BooleanConfiguration` element has the following attributes:\n\n### Required attributes\n\nThe following attributes are required:\n\n`id`\n: A unique identifier for the configuration value.\n\n`displayName`\n: A resource ID corresponding to the text that is displayed in the watch\n face editor.\n\n`defaultValue`\n: The default configuration value used if the user does not explicitly change\n the configuration in the watch face editor.\n\n### Optional attributes\n\nThe following attributes are optional:\n\n`icon`\n: A resource ID corresponding to the drawable resource which is shown in\n the watch face editor. This should have a maximum size of 400x400 px.\n\n`screenReaderText`\n: A resource ID corresponding to the text which is used if the user has\n [TalkBack](https://support.google.com/wearos/answer/7313945) enabled.\n\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [BooleanConfiguration](/training/wearables/wff/v2/user-configuration/boolean-configuration)\n- [Flavor](/training/wearables/wff/v2/user-configuration/flavor)\n- [Flavor](/training/wearables/wff/user-configuration/flavor)"]]