Watch Face Format version <button value="5" default="">Version 5</button> <button value="4">Version 4</button> <button value="3">Version 3</button> <button value="2">Version 2</button> <button value="1">Version 1</button>

*** ** * ** ***

Provides comparison logic for conditionally enabling the appearance, animation,
and event handling of child elements.

Introduced in Wear OS 4.

## Syntax

```xml
<Condition>
    <!-- The "Expressions" element is required. -->
    <Expressions>
        <Expression name="unique-name">
            <!-- Arithmetic expression goes here. -->
        </Expression>
        <!-- Other expressions go here. -->
    </Expressions>
    <!-- The "expression" attribute is required. -->
    <Compare expression="expression-name">
        <!-- ONE of the following only: -->
        <Group ... />
        <PartText ... />
        <PartImage ... />
        <PartAnimatedImage ... />
        <PartDraw ... />
        <Condition ... />
        <AnalogClock ... />
        <DigitalClock ... />
    </Compare>
    <!-- The "else" case for when all of the above "Compare"
         conditions are false. -->
    <Default>
        <!-- ONE of the following only: -->
        <Group ... />
        <PartText ... />
        <PartImage ... />
        <PartAnimatedImage ... />
        <PartDraw ... />
        <Condition ... />
        <AnalogClock ... />
        <DigitalClock ... />
    </Default>
</Condition>
```

## Inner elements

The `Condition` element contains the following inner elements:

`Expressions`

:   Defines a set of `Expression` elements that each have a `name` attribute and
    contain an [arithmetic expression](https://developer.android.com/training/wearables/wff/common/attributes/arithmetic-expression). The `name` must be unique within the
    containing `Condition` element.

    A `Condition` element must contain at least one `Expressions` element.

`Compare`

:   Contains a single element tree that is visible, animated, and receptive to
    events only if the expression with the given name evaluates to `true` or a
    non-zero value. The `name` attribute must match the `name` attribute of an
    `Expression` element used elsewhere in the `Condition` element.

`Default`

:   Contains a single element tree that is visible, animated, and receptive to
    events only when none of the `Compare` element groups are activated.

## Recommended for you

- Note: link text is displayed when JavaScript is off
- [AGSL Quick Reference](https://developer.android.com/develop/ui/views/graphics/agsl/agsl-quick-reference)
- [Define data using Room entities](https://developer.android.com/training/data-storage/room/defining-data)
- [Data Binding in Android](https://developer.android.com/codelabs/android-databinding)