Частичный текст

Представляет часть часового лица, которая содержит ровно один элемент макета текста.

Представлено в Wear OS 4.

Синтаксис

<PartText x="integer" y="integer" width="integer" height="integer"
           pivotX="float" pivotY="float" angle="float-degrees" alpha="integer"
           name="string" scaleX="float" scaleY="float"
           renderMode="[SOURCE | MASK | ALL]"
           tintColor="argb-color | rgb-color">
    <!-- Text-specific child elements. -->
    <Text>
        <!-- There must be raw text as the leaf inner element within a
            "PartText" element tree. -->
        <Font family="font" size="20" color="#00FFFF">Hello world
        </Font>
        <Font>
            <!-- Example of a text decoration element. -->
            <Outline>
                <!-- Example of a template with 2 string values. -->
                <Template>%s %s
                    <Parameter expression="[MONTH_S]" />
                    <Parameter expression="[DAY]" />
                </Template>
            </Outline>
            <!-- Example of a text formatting element. -->
            <Upper>
                <Template ... />
            </Upper>
            <Template ... />
        </Font>
    </Text>
    <!-- A "PartText" element can contain this "TextCircular" element instead
         of a "Text" element. -->
    <TextCircular centerX="180" centerY="180" direction="COUNTER_CLOCKWISE"
                  endAngle="90" height="340" width="340" startAngle="270">
        There must be raw text as the leaf inner element within a "PartText"
        element tree.
        <Font family="font" size="20" color="#00FFFF">Hello world
        </Font>
        <Font>
            Example of a text decoration element.
            <Outline>
                Example of a template with 2 string values.
                <Template>%s %s
                    <Parameter expression="[MONTH_S]" />
                    <Parameter expression="[DAY]" />
                </Template>
            </Outline>
            Example of a text formatting element.
            <Upper>
                <Template ... />
            </Upper>
            <Template ... />
        </Font>
    </TextCircular />
    -->

    <!-- Child elements that are shared across all "Part" elements. -->
    <Localization .../>
    <Transform .../>
    <Variant .../>
    <Gyro .../>
    <Launch .../>
    <ScreenReader .../>
</PartText>

Атрибуты

Элемент PartText имеет следующие атрибуты:

Обязательные атрибуты

Обязательны следующие атрибуты:

x , y , width , height
Коллекция целых чисел, определяющих размер и положение элемента.

Дополнительные атрибуты

Следующие атрибуты являются необязательными:

pivotX , pivotY
Двумерная точка поворота, о которой вращается элемент. 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.
name
Строка, идентифицирующая этот элемент. Useful if you need to refer to this element from another location within your watch face file.
scaleX
The horizontal scaling factor to apply to this element.
scaleY
The vertical scaling factor to apply to this element.
renderMode
Тип режима рендеринга элемента. Possible values are: SOURCE (default), MASK , or ALL .
tintColor
Примените к элементу фильтр оттенка цвета. You must specify the color using either the ARGB format ( #ff000000 = opaque black) or the RGB format ( #000000 = black).

Внутренние элементы

The PartText element can contain the following inner elements. All elements are optional, except that either Text or TextCircular must be one of the inner elements. Элемент PartText может содержать неограниченное количество каждого внутреннего элемента — за исключением Text , TextCircular , Localization , Gyro , Launch и ScreenReader , каждый из которых может появляться не более 1 раза.

{% дословно %} {% дословно %} {% дословно %} {% дословно %}