Allows watch face creators to define modified appearances, by changing the values of specific color and geometric properties, when the Wear OS device is in different display modes. As of Wear OS 4, the only supported mode is ambient mode.
Introduced in Wear OS 4.
Syntax
<Variant mode="AMBIENT" target="attribute-name" value="valid-value" />
Attributes
The Variant element has the following required attributes:
modeThe mode that the Wear OS device must be in for the variant to take effect.
As of Wear OS 4, this value must be
AMBIENT.targetThe attribute whose value should change when the specified Wear OS device mode takes effect. This must be a transformable attribute.
valueThe value that the attribute should have when the specified Wear OS device mode takes effect.
Optional attributes
The following attributes are optional:
duration- Starting with version 4, the transition between interactive and ambient states
is animated. The
durationattribute takes values between0.0and1.0to control how long this animation takes, where1.0is the full extent allowed by the device, and is the default value.0.0represents no animation. startOffsetControls the delay before the start of the transition animation, taking a value in the range
0.0to1.0. The default is0.0.If the sum of
durationandstartOffsetis greater than1.0, thenstartOffsetis ignored.Example: Starting an animation halfway through the ambient to interactive transition, and using the full extent of the time available:
<Variant mode="AMBIENT" target="x" value="100" startOffset="0.5" duration="0.5"/>interpolationThe interpolation method to use for this animation. Possible values include the following:
LINEAR(default)EASE_INEASE_OUTEASE_IN_OUTOVERSHOOTCUBIC_BEZIER
controlsA 4-component vector that represents the position of the control points for the animation. The default value is
<0.5, 0.5, 0.5, 0.5>.This attribute takes effect only when
interpolationis set toCUBIC_BEZIER.angleDirectionThe direction to use when applying angular rotation to the animation. Possible values include the following:
NONE(default): No angular rotationCLOCKWISE: Animate in the clockwise directionCOUNTER_CLOCKWISE: Animate in the counterclockwise direction
Recommended for you
- Note: link text is displayed when JavaScript is off
- Features and APIs Overview
- Transform
- Layouts and binding expressions