LayoutElementBuilders.SpanText.Builder


public final class LayoutElementBuilders.SpanText.Builder


Builder for SpanText.

Summary

Public constructors

Creates an instance of Builder.

Public methods

@NonNull LayoutElementBuilders.SpanText

Builds an instance from accumulated values.

@NonNull LayoutElementBuilders.SpanText.Builder

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

@NonNull LayoutElementBuilders.SpanText.Builder

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

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

Sets the text to render.

@NonNull LayoutElementBuilders.SpanText.Builder

Sets the text to render.

Public constructors

Builder

Added in 1.0.0
public Builder()

Creates an instance of Builder.

Public methods

build

Added in 1.0.0
public @NonNull LayoutElementBuilders.SpanText build()

Builds an instance from accumulated values.

setFontStyle

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

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)
public @NonNull LayoutElementBuilders.SpanText.Builder setText(@NonNull String text)

Sets the text to render.

setText

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

Sets the text to render.

Note that this field only supports static values.