ComplicationSlot


A Complication Slot is an area of the watch face that a Complication can be added by the user. Complication Slots contain Complication elements, which define how the Complication is rendered for different Complication Types and in different watch face modes.

Introduced in Wear OS 4.

Syntax

<ComplicationSlot x="integer" y="integer" width="integer"
             height="integer" pivotX="float" pivotY="float"
             angle="float-degrees" alpha="integer" slotId="integer"
             name="string" displayName="string" scaleX="float" scaleY="float"
             supportedTypes="string" isCustomizable="boolean"
             tintColor="argb-color | rgb-color" />

Attributes

The ComplicationSlot 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.
slotId
A unique numeric identifier for the slot.
supportedTypes
A list of the supported Complication Types that can populate the slot. Supported values are SHORT_TEXT, LONG_TEXT, MONOCHROMATIC_IMAGE, SMALL_IMAGE, PHOTO_IMAGE, RANGED_VALUE, and EMPTY. Multiple complication types can be supported by separating them with a space (for example, SHORT_TEXT RANGED_VALUE).

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.
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).
displayName
A resource ID corresponding to a localized name for the complication slot, which is displayed in the watch face editor.
isCustomizable
Determines whether a user can change the provider for this slot in the watch face editor. Defaults to TRUE.

Inner elements

The ComplicationSlot element must contain exactly one Bounding Area element.

A ComplicationSlot element must contain at least a Complication element per supported Complication Type. A ComplicationSlot element can optionally contain more Complication elements to support changing appearance with Variant elements.

The ComplicationSlot element can also contain the following inner elements: