AnimationController

An animation controller controls the playback of animations on the watch face.

Syntax

<AnimationController play="TAP | ON_VISIBLE | ON_NEXT_SECOND |
                           ON_NEXT_MINUTE | ON_NEXT_HOUR"
                        delayPlay="float" delayRepeat="float
                        repeat="boolean" loopCount="integer"
                        resumePlayBack="boolean" beforePlaying="string"
                        afterPlaying="string" />

Attributes

The AnimationController element has the following attributes:

Required attributes

The following attributes are required:

play

An event trigger type which determines when the animation plays. Possible values include the following:

  • TAP: The animation plays when the user taps on the element.
  • ON_VISIBLE: The animation plays when the element next becomes visible.
  • ON_NEXT_SECOND: The animation plays when the next second begins.
  • ON_NEXT_MINUTE: The animation plays when the next minute begins.
  • ON_NEXT_HOUR: The animation plays when the next hour begins.

Optional attributes

The following attributes are optional:

delayPlay
A delay in seconds before the animation plays. Defaults to 0.
delayRepeat
A delay in seconds before an animation repeats. Defaults to 0.
repeat
Whether to repeat the animation when it finishes, playing it indefinitely. Defaults to FALSE.
loopCount
How many times to repeat an animation before it stops. If repeat is set to TRUE, it takes precedence and this value is ignored. Defaults to 1.
resumePlayBack
Animations pause when the watch face is not visible. If resumePlayBack is TRUE, the animation continues from the same frame that was shown when the watch face previously became not visible. If resumePlayBack is set to FALSE, the animation restarts from the beginning when the watch face becomes visible again. Defaults to FALSE.
beforePlaying, afterPlaying

Define the state of the animation element before it can play, or after it has finished. These attributes can be set to the following values:

  • DO_NOTHING causes no change to the rendered state of the element.
  • FIRST_FRAME fixes the rendering of the element to the first frame of the animation.
  • THUMBNAIL fixes the rendering of the element to the thumbnail resource provided by the animated resource.
  • HIDE hides the animation.

Both attributes default to DO_NOTHING.