The AnalogClock element has the following attributes:
Required attributes
The following attributes are required:
x, y, width, height
A collection of integers that specify the element's size and position.
Optional attributes
The following attributes are optional:
pivotX, pivotY
A two-dimensional pivot point about which the element rotates. Both values
are floating-point numbers that are scaled to fit in the range $ [0, 1] $.
angle
A number of degrees, clockwise, that the element should be rotated about its
pivot point.
alpha
Set the level of transparency that this element should have. A value of 0
indicates that the element should be completely transparent. A value of 255
indicates that the element should be completely opaque.
scaleX
The horizontal scaling factor to apply to this element.
scaleY
The vertical scaling factor to apply to this element.
renderMode
The element's render mode type. Possible values are: SOURCE (default),
MASK, or ALL.
tintColor
Apply a tint color filter to the element. You must specify the color using
either the ARGB format (#ff000000 = opaque black) or the RGB format
(#000000 = black).
Inner elements
The AnalogClock element can contain the following inner elements:
Elements that represent the hour, minute, and second hands, respectively, that
rotate around the watch face. AnalogClock can contain at most 2 hour hands, 2
minute hands, and 2 second hands.
Localization
Provides a hint for the locale to use when rendering the time. More
information is available in the Localization reference.
An AnalogClock element can contain at most one Localization element.
Variant
Allows for changing attributes of this element when the Wear OS device is in
ambient mode. More information is available in the Variant reference.
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,["# AnalogClock\n\nWatch Face Format version Version 4 Version 3 Version 2 Version 1\n\n*** ** * ** ***\n\nAn analog clock is a container for `AnalogHands` inner elements, which display\na series of clock hands that rotate around a watch face.\n\nIntroduced in Wear OS 4.\n\nSyntax\n------\n\n```xml\n\u003cAnalogClock x=\"integer\" y=\"integer\" width=\"integer\" height=\"integer\"\n pivotX=\"float\" pivotY=\"float\" angle=\"float-degrees\" alpha=\"integer\"\n scaleX=\"float\" scaleY=\"float\"\n renderMode=\"[SOURCE | MASK | ALL]\"\n tintColor=\"argb-color | rgb-color\"\u003e\n \u003c!-- This is the maximum number of hands that you can define. --\u003e\n \u003cHourHand ... /\u003e\n \u003cHourHand ... /\u003e\n \u003cMinuteHand ... /\u003e\n \u003cMinuteHand ... /\u003e\n \u003cSecondHand ... /\u003e\n \u003cSecondHand ... /\u003e\n\u003c/AnalogClock\u003e\n```\n\nAttributes\n----------\n\nThe `AnalogClock` element has the following attributes:\n\n### Required attributes\n\nThe following attributes are required:\n\n`x`, `y`, `width`, `height`\n: A collection of integers that specify the element's size and position.\n\n### Optional attributes\n\nThe following attributes are optional:\n\n`pivotX`, `pivotY`\n: A two-dimensional pivot point about which the element rotates. Both values\n are floating-point numbers that are scaled to fit in the range $ \\[0, 1\\] $.\n\n`angle`\n: A number of degrees, clockwise, that the element should be rotated about its\n pivot point.\n\n`alpha`\n: Set the level of transparency that this element should have. A value of `0`\n indicates that the element should be completely transparent. A value of `255`\n indicates that the element should be completely opaque.\n\n`scaleX`\n: The horizontal scaling factor to apply to this element.\n\n`scaleY`\n: The vertical scaling factor to apply to this element.\n\n`renderMode`\n: The element's render mode type. Possible values are: `SOURCE` (default),\n `MASK`, or `ALL`.\n\n`tintColor`\n: Apply a tint color filter to the element. You must specify the color using\n either the ARGB format (`#ff000000` = opaque black) or the RGB format\n (`#000000` = black).\n\nInner elements\n--------------\n\nThe `AnalogClock` element can contain the following inner elements:\n\n[`HourHand`](/training/wearables/wff/clock/hour-hand)\n[`MinuteHand`](/training/wearables/wff/clock/minute-hand)\n[`SecondHand`](/training/wearables/wff/clock/second-hand)\n: Elements that represent the hour, minute, and second hands, respectively, that\n rotate around the watch face. `AnalogClock` can contain at most 2 hour hands, 2\n minute hands, and 2 second hands.\n\n`Localization`\n: Provides a hint for the locale to use when rendering the time. More\n information is available in the [`Localization`](/training/wearables/wff/common/localization) reference.\n\nAn `AnalogClock` element can contain at most one `Localization` element.\n\n`Variant`\n: Allows for changing attributes of this element when the Wear OS device is in\n ambient mode. More information is available in the [`Variant`](/training/wearables/wff/common/variant/variant) reference.\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [Group](/training/wearables/wff/group/group)\n- [DigitalClock](/training/wearables/wff/clock/digital-clock)\n- [PartImage](/training/wearables/wff/group/part/image/part-image)"]]