public final class

LayoutElementBuilders.Text.Builder

extends java.lang.Object

implements LayoutElementBuilders.LayoutElement.Builder

 java.lang.Object

↳androidx.wear.tiles.LayoutElementBuilders.Text.Builder

Overview

Builder for LayoutElementBuilders.Text.

Summary

Constructors
publicBuilder()

Methods
public LayoutElementBuilders.Textbuild()

public LayoutElementBuilders.Text.BuildersetFontStyle(LayoutElementBuilders.FontStyle fontStyle)

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

public LayoutElementBuilders.Text.BuildersetLineHeight(DimensionBuilders.SpProp lineHeight)

Sets the explicit height between lines of text.

public LayoutElementBuilders.Text.BuildersetMaxLines(int maxLines)

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

public LayoutElementBuilders.Text.BuildersetMaxLines(TypeBuilders.Int32Prop maxLines)

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

public LayoutElementBuilders.Text.BuildersetModifiers(ModifiersBuilders.Modifiers modifiers)

Sets ModifiersBuilders.Modifiers for this element.

public LayoutElementBuilders.Text.BuildersetMultilineAlignment(int multilineAlignment)

Sets alignment of the text within its bounds.

public LayoutElementBuilders.Text.BuildersetMultilineAlignment(LayoutElementBuilders.TextAlignmentProp multilineAlignment)

Sets alignment of the text within its bounds.

public LayoutElementBuilders.Text.BuildersetOverflow(int overflow)

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

public LayoutElementBuilders.Text.BuildersetOverflow(LayoutElementBuilders.TextOverflowProp overflow)

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

public LayoutElementBuilders.Text.BuildersetText(java.lang.String text)

Sets the text to render.

public LayoutElementBuilders.Text.BuildersetText(TypeBuilders.StringProp text)

Sets the text to render.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Methods

Sets the text to render.

public LayoutElementBuilders.Text.Builder setText(java.lang.String text)

Sets the text to render.

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

Sets ModifiersBuilders.Modifiers for this element.

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

public LayoutElementBuilders.Text.Builder setMaxLines(int maxLines)

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

public LayoutElementBuilders.Text.Builder setMultilineAlignment(LayoutElementBuilders.TextAlignmentProp multilineAlignment)

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

public LayoutElementBuilders.Text.Builder setMultilineAlignment(int multilineAlignment)

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

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

public LayoutElementBuilders.Text.Builder setOverflow(int overflow)

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

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