LayoutElementBuilders.SpanText.Builder


class LayoutElementBuilders.SpanText.Builder


Builder for SpanText.

Summary

Public constructors

Creates an instance of Builder.

Public functions

LayoutElementBuilders.SpanText

Builds an instance from accumulated values.

LayoutElementBuilders.SpanText.Builder

Sets the style of font to use (size, bold etc).

LayoutElementBuilders.SpanText.Builder

Sets androidx.wear.protolayout.ModifiersBuilders.Modifiers for this element.

LayoutElementBuilders.SpanText.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setText(text: String)

Sets the text to render.

LayoutElementBuilders.SpanText.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setText(text: TypeBuilders.StringProp)

Sets the text to render.

Public constructors

Builder

Added in 1.0.0
Builder()

Creates an instance of Builder.

Public functions

build

Added in 1.0.0
fun build(): LayoutElementBuilders.SpanText

Builds an instance from accumulated values.

setFontStyle

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setFontStyle(fontStyle: LayoutElementBuilders.FontStyle): LayoutElementBuilders.SpanText.Builder

Sets the style of font to use (size, bold etc). If not specified, defaults to the platform's default body font.

DynamicColor is not supported for SpanText.

setText

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setText(text: String): LayoutElementBuilders.SpanText.Builder

Sets the text to render.

setText

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setText(text: TypeBuilders.StringProp): LayoutElementBuilders.SpanText.Builder

Sets the text to render.

Note that this field only supports static values.