LayoutElementBuilders.Text

public static final class LayoutElementBuilders.Text
extends Object implements LayoutElementBuilders.LayoutElement

java.lang.Object
   ↳ androidx.wear.tiles.LayoutElementBuilders.Text


A text string.

Summary

Nested classes

class LayoutElementBuilders.Text.Builder

Builder for LayoutElementBuilders.Text

Public methods

static LayoutElementBuilders.Text.Builder builder()

Returns a new LayoutElementBuilders.Text.Builder.

LayoutElementBuilders.FontStyle getFontStyle()

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

DimensionBuilders.SpProp getLineHeight()

Gets the explicit height between lines of text.

TypeBuilders.Int32Prop getMaxLines()

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

ModifiersBuilders.Modifiers getModifiers()

Gets ModifiersBuilders.Modifiers for this element.

LayoutElementBuilders.TextAlignmentProp getMultilineAlignment()

Gets alignment of the text within its bounds.

LayoutElementBuilders.TextOverflowProp getOverflow()

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

TypeBuilders.StringProp getText()

Gets the text to render.

Inherited methods

Public methods

getFontStyle

public 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.

Returns
LayoutElementBuilders.FontStyle

getLineHeight

public 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.

Returns
DimensionBuilders.SpProp

getMaxLines

public TypeBuilders.Int32Prop getMaxLines ()

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

Returns
TypeBuilders.Int32Prop

getModifiers

public ModifiersBuilders.Modifiers getModifiers ()

Gets ModifiersBuilders.Modifiers for this element. Intended for testing purposes only.

Returns
ModifiersBuilders.Modifiers

getMultilineAlignment

public LayoutElementBuilders.TextAlignmentProp getMultilineAlignment ()

Gets alignment of the text within its bounds. Note that a LayoutElementBuilders.Text element will size itself to wrap its contents, so this option is meaningless for single-line text (for that, use alignment of the outer container). For multi-line text, however, this will set the alignment of lines relative to the LayoutElementBuilders.Text element bounds. If not defined, defaults to TEXT_ALIGN_CENTER. Intended for testing purposes only.

Returns
LayoutElementBuilders.TextAlignmentProp

getOverflow

public LayoutElementBuilders.TextOverflowProp getOverflow ()

Gets how to handle text which overflows the bound of the LayoutElementBuilders.Text element. A LayoutElementBuilders.Text element will grow as large as possible inside its parent container (while still respecting max_lines); if it cannot grow large enough to render all of its text, the text which cannot fit inside its container will be truncated. If not defined, defaults to TEXT_OVERFLOW_TRUNCATE. Intended for testing purposes only.

Returns
LayoutElementBuilders.TextOverflowProp

getText

public TypeBuilders.StringProp getText ()

Gets the text to render. Intended for testing purposes only.

Returns
TypeBuilders.StringProp