A time text is a formatted string representing the current time.
Introduced in Wear OS 4.
<TimeText format="string" hourFormat="12 | 24 | SYNC_TO_DEVICE" align="START | CENTER | END" x="integer" y="integer" width="integer" height="integer" pivotX="float" pivotY="float" angle="float-degrees" alpha="integer" tintColor="argb-color | rgb-color" />
TimeText element has the following attributes:
A format string representing the time format.
This list includes several different formats for showing the time 9:01:05 AM:
hh:mm:ssrenders as "09:01:05".
h:mmrenders as "9:01"
ssrenders as "05"
mrenders as "1"
Whether to use 12- or 24-hour notation to display the time. Defaults to
SYNC_TO_DEVICE, which applies the user's preference that's configured on the device.
How to align the text within the bounding box. Defaults to "START".
A collection of integers that specify the element's size and position.
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] $.
A number of degrees, clockwise, that the element should be rotated about its pivot point.
Set the level of transparency that this element should have. A value of
0indicates that the element should be completely transparent. A value of
255indicates that the element should be completely opaque.
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 (
TimeText element can contain the following inner elements:
- Allows for changing attributes of this element when the Wear OS device is in
ambient mode. More information is available in the
- A BitmapFont to use for rendering the time.
- A Font to use for rendering the time.