LayoutElementBuilders.Text

public final class LayoutElementBuilders.Text implements LayoutElementBuilders.LayoutElement


A text string.

Summary

Nested types

LayoutElementBuilders.Text.Builder

Builder for Text.

Public constructors

Public methods

@Nullable LayoutElementBuilders.FontStyle

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

@Nullable DimensionBuilders.SpProp

Gets the explicit height between lines of text.

@Nullable TypeBuilders.Int32Prop

Gets the maximum number of lines that can be represented by the Text element.

@Nullable ModifiersBuilders.Modifiers

Gets androidx.wear.tiles.ModifiersBuilders.Modifiers for this element.

@Nullable LayoutElementBuilders.TextAlignmentProp

Gets alignment of the text within its bounds.

@Nullable LayoutElementBuilders.TextOverflowProp

Gets how to handle text which overflows the bound of the Text element.

@Nullable TypeBuilders.StringProp

Gets the text to render.

Public constructors

Text

public final Text()

Public methods

getFontStyle

public @Nullable LayoutElementBuilders.FontStyle getFontStyle()

Gets the style of font to use (size, bold etc). If not specified, defaults to the platform's default body font. Intended for testing purposes only.

getLineHeight

public @Nullable DimensionBuilders.SpProp getLineHeight()

Gets the explicit height between lines of text. This is equivalent to the vertical distance between subsequent baselines. If not specified, defaults the font's recommended interline spacing. Intended for testing purposes only.

getMaxLines

public @Nullable TypeBuilders.Int32Prop getMaxLines()

Gets the maximum number of lines that can be represented by the Text element. If not defined, the Text element will be treated as a single-line element. Intended for testing purposes only.

getModifiers

public @Nullable ModifiersBuilders.Modifiers getModifiers()

Gets androidx.wear.tiles.ModifiersBuilders.Modifiers for this element. Intended for testing purposes only.

getMultilineAlignment