Stay organized with collections
Save and categorize content based on your preferences.
Applies an animation to the parent Transform element within the watch
face XML file. In cases where a Transform element changes the value of a
specific attribute, a child Animation element updates the changed value
gradually on the watch face.
The Animation element has the following attributes:
Required attributes
The following attributes are required:
duration
The duration of the animation, in seconds. This attribute is required.
Optional attributes
The following attributes are optional:
interpolation
The interpolation method to use for this animation. Possible values include
the following:
LINEAR (default)
EASE_IN
EASE_OUT
EASE_IN_OUT
OVERSHOOT
CUBIC_BEZIER
controls
A 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 interpolation is set to CUBIC_BEZIER.
angleDirection
The direction to use when applying angular rotation to this animation.
Possible values include the following:
NONE (default): No angular rotation
CLOCKWISE: Animate in the clockwise direction
COUNTER_CLOCKWISE: Animate in the counterclockwise direction
repeat
Indicates the number of times that the animation should repeat. A value of 0
(the default value) causes the animation to never repeat. A value of -1 means
the animation will loop indefinitely.
fps
The animation rate, in frames per second. The default value is 15.
Recommended for you
Note: link text is displayed when JavaScript is off
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.
[null,null,["Last updated 2025-05-20 UTC."],[],[],null,["# Animation\n\nWatch Face Format version Version 4 Version 3 Version 2 Version 1\n\n*** ** * ** ***\n\nApplies an animation to the parent [`Transform`](/training/wearables/wff/common/transform/transform) element within the watch\nface XML file. In cases where a `Transform` element changes the value of a\nspecific attribute, a child `Animation` element updates the changed value\ngradually on the watch face.\n\nIntroduced in Wear OS 4.\n\nSyntax\n------\n\n```xml\n\u003cTransform ...\u003e\n \u003c!-- Only the \"duration\" attribute is required. --\u003e\n \u003cAnimation interpolation=\"LINEAR | EASE_IN | EASE_OUT | EASE_IN_OUT |\n OVERSHOOT | CUBIC_BEZIER\" controls=\"four-component-vector\"\n angleDirection=\"NONE | CLOCKWISE | COUNTER_CLOCKWISE\"\n repeat=\"integer\" fps=\"integer\"\n duration=\"float\"\u003e\n \u003c/Animation\u003e\n\u003c/Transform\u003e\n```\n\nAttributes\n----------\n\nThe `Animation` element has the following attributes:\n\n### Required attributes\n\nThe following attributes are required:\n\n`duration`\n: The duration of the animation, in seconds. This attribute is required.\n\n### Optional attributes\n\nThe following attributes are optional:\n\n`interpolation`\n\n: The interpolation method to use for this animation. Possible values include\n the following:\n\n - `LINEAR` (default)\n - `EASE_IN`\n - `EASE_OUT`\n - `EASE_IN_OUT`\n - `OVERSHOOT`\n - `CUBIC_BEZIER`\n\n`controls`\n\n: A 4-component vector that represents the position of the control points for\n the animation. The default value is \\\u003c0.5, 0.5, 0.5, 0.5\\\u003e.\n\n This attribute takes effect only when `interpolation` is set to `CUBIC_BEZIER`.\n\n`angleDirection`\n\n: The direction to use when applying angular rotation to this animation.\n Possible values include the following:\n\n - `NONE` (default): No angular rotation\n - `CLOCKWISE`: Animate in the clockwise direction\n - `COUNTER_CLOCKWISE`: Animate in the counterclockwise direction\n\n`repeat`\n\n: Indicates the number of times that the animation should repeat. A value of `0`\n (the default value) causes the animation to never repeat. A value of `-1` means\n the animation will loop indefinitely.\n\n`fps`\n\n: The animation rate, in frames per second. The default value is `15`.\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [AGSL Quick Reference](/develop/ui/views/graphics/agsl/agsl-quick-reference)\n- [Background playback with a `MediaSessionService` {:#overview}](/media/media3/session/background-playback)\n- [Arc](/training/wearables/wff/group/part/draw/shape/arc)"]]