Specifies a circular or curved text configuration.
Introduced in Wear OS 4.
Syntax
<TextCircular centerX="float" centerY="float" direction="CLOCKWISE | COUNTER_CLOCKWISE" width="float" height="float" startAngle="float-degrees" endAngle="float-degrees" align="START | CENTER | END" ellipsis="boolean" > <!-- Possible inner elements. The PartText element syntax shows a more complete example. --> <Transform .../> <Font ... /> <BitmapFont ... /> </TextCircular>
Attributes
The TextCircular element has the following attributes. Some attributes are
required while others are optional.
Required attributes
The following attributes are required:
centerXandcenterYA pair of floating-point values that specify the position of the element's center.
These attributes are transformable.
widthandheightA pair of floating-point values that specify the element's size.
startAngleandendAngleA pair of floating-point values that specify the angle of the text's starting side and the angle of the text's ending side, respectively. An angle of 0 degrees represents the 12 o'clock position on the watch face.
For example, to curve text around the top quarter of the watch face, use a
startAngleof335.0and anendAngleof45.0.These attributes are transformable.
Optional attributes
The following attributes are optional:
directionIndicates the direction in which the text is written:
CLOCKWISE(default): Show text in the clockwise direction.COUNTER_CLOCKWISE: Show text in the counterclockwise direction.
alignDetermines the text's alignment within its parent element:
START: left- or top-aligned (right-aligned when the current language uses an RTL text direction)CENTER: center-alignedEND: right- or bottom-aligned (left-aligned when the current language uses an RTL text direction)
The default value is
CENTER.ellipsisA boolean value that indicates whether to show an ellipsis if the text is too long to fit in the parent element. The default is
FALSE.
verticalAlignHow to align the text vertically within the bounding box:
TOP: the text top edge is aligned on the top of the bounding box.BOTTOM: the text bottom edge is aligned on the bottom of the bounding box.CENTER: the text center is aligned on the center of the bounding box.CENTER_ON_BASELINE: the text baseline is aligned on the center of the bounding box.
isAutoSize- Downscales the font size to fit the bounds of the containing
PartText, with a minimum font size of 12px, or the FontminSizesince v5. If used in conjunction withellipsis, first the text is scaled down, then if the text still exceeds the bounds, the ellipsis is applied.
Inner elements
The Text element can contain any number of the following inner elements:
Recommended for you
- Note: link text is displayed when JavaScript is off
- TextCircular
- Arc
- Text