Text.Builder
public final class Text.Builder implements LayoutElementBuilders.LayoutElement.Builder
Builder class for Text.
Summary
Public constructors |
|---|
|
Creates a builder for |
Public methods |
|
|---|---|
@NonNull Text |
Constructs and returns |
@NonNull Text.Builder |
Sets the color for the |
@NonNull Text.Builder |
Sets the text to be italic. |
@NonNull Text.Builder |
Sets the maximum lines of text. |
@NonNull Text.Builder |
Sets the modifiers of text. |
@NonNull Text.Builder |
Sets the multiline alignment for text within bounds of the Text element. |
@NonNull Text.Builder |
Sets the overflow for text. |
@NonNull Text.Builder |
Sets the typography for the |
@NonNull Text.Builder |
Sets the text to be underlined. |
@NonNull Text.Builder |
Sets the weight of the font. |
Public constructors
Public methods
public @NonNull Text.BuildersetColor(@NonNull ColorBuilders.ColorProp color)
Sets the color for the Text. If not set, onPrimary color from the DEFAULT will be used.
public @NonNull Text.BuildersetItalic(boolean italic)
Sets the text to be italic. If not set, false will be used.
public @NonNull Text.BuildersetMaxLines(@IntRange(from = 1) int maxLines)
Sets the maximum lines of text. If not set, 1 will be used.
public @NonNull Text.BuildersetModifiers(@NonNull ModifiersBuilders.Modifiers modifiers)
Sets the modifiers of text.
public @NonNull Text.BuildersetMultilineAlignment(int multilineAlignment)
Sets the multiline alignment for text within bounds of the Text element. Note that this option has no effect for single line of text, and for that, alignment on the outer container should be used. If not set, TEXT_ALIGN_CENTER will be used.
public @NonNull Text.BuildersetOverflow(int overflow)
Sets the overflow for text. If not set, TEXT_OVERFLOW_ELLIPSIZE_END will be used.
public @NonNull Text.BuildersetTypography(int typography)
Sets the typography for the Text. If not set, TYPOGRAPHY_DISPLAY1 will be used.
public @NonNull Text.BuildersetUnderline(boolean underline)
Sets the text to be underlined. If not set, false will be used.
public @NonNull Text.BuildersetWeight(int weight)
Sets the weight of the font. If not set, default weight for the chosen Typography will be used.