LayoutElementBuilders.Text
public final class LayoutElementBuilders.Text implements LayoutElementBuilders.LayoutElement
A text string.
Summary
Nested types |
|---|
public final class LayoutElementBuilders.Text.Builder implements LayoutElementBuilders.LayoutElement.BuilderBuilder for |
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 |
@Nullable ModifiersBuilders.Modifiers |
Gets |
@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 |
@Nullable TypeBuilders.StringProp |
Gets the text to render. |
Public methods
public @Nullable LayoutElementBuilders.FontStylegetFontStyle()
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.
public @Nullable DimensionBuilders.SpPropgetLineHeight()
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.
public @Nullable TypeBuilders.Int32PropgetMaxLines()
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.
public @Nullable ModifiersBuilders.ModifiersgetModifiers()
Gets androidx.wear.tiles.ModifiersBuilders.Modifiers for this element. Intended for testing purposes only.
public @Nullable LayoutElementBuilders.TextAlignmentPropgetMultilineAlignment()
Gets alignment of the text within its bounds. Note that a 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 Text element bounds. If not defined, defaults to TEXT_ALIGN_CENTER. Intended for testing purposes only.
public @Nullable LayoutElementBuilders.TextOverflowPropgetOverflow()
Gets how to handle text which overflows the bound of the Text element. A 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.
public @Nullable TypeBuilders.StringPropgetText()
Gets the text to render. Intended for testing purposes only.