public final class

LayoutElementBuilders.Spannable.Builder

extends java.lang.Object

implements LayoutElementBuilders.LayoutElement.Builder

 java.lang.Object

↳androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder

Overview

Builder for LayoutElementBuilders.Spannable.

Summary

Constructors
publicBuilder()

Creates an instance of LayoutElementBuilders.FontWeightProp.Builder.

Methods
public LayoutElementBuilders.Spannable.BuilderaddSpan(LayoutElementBuilders.Span span)

Adds one item to the LayoutElementBuilders.Span elements that form this LayoutElementBuilders.Spannable.

public LayoutElementBuilders.Spannablebuild()

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

Sets the explicit height between lines of text.

public LayoutElementBuilders.Spannable.BuildersetMarqueeIterations(int marqueeIterations)

Sets the number of times to repeat the Marquee animation.

public LayoutElementBuilders.Spannable.BuildersetMaxLines(int maxLines)

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

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

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

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

Sets ModifiersBuilders.Modifiers for this element.

public LayoutElementBuilders.Spannable.BuildersetMultilineAlignment(int multilineAlignment)

Sets alignment of the LayoutElementBuilders.Spannable content within its bounds.

public LayoutElementBuilders.Spannable.BuildersetMultilineAlignment(LayoutElementBuilders.HorizontalAlignmentProp multilineAlignment)

Sets alignment of the LayoutElementBuilders.Spannable content within its bounds.

public LayoutElementBuilders.Spannable.BuildersetOverflow(int overflow)

Sets how to handle content which overflows the bound of the LayoutElementBuilders.Spannable element.

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

Sets how to handle content which overflows the bound of the LayoutElementBuilders.Spannable element.

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

Constructors

public Builder()

Creates an instance of LayoutElementBuilders.FontWeightProp.Builder.

Methods

Adds one item to the LayoutElementBuilders.Span elements that form this LayoutElementBuilders.Spannable.

Sets ModifiersBuilders.Modifiers for this element.

Sets the maximum number of lines that can be represented by the LayoutElementBuilders.Spannable element. If not defined, the LayoutElementBuilders.Spannable element will be treated as a single-line element.

public LayoutElementBuilders.Spannable.Builder setMaxLines(int maxLines)

Sets the maximum number of lines that can be represented by the LayoutElementBuilders.Spannable element. If not defined, the LayoutElementBuilders.Spannable element will be treated as a single-line element.

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

public LayoutElementBuilders.Spannable.Builder setMultilineAlignment(int multilineAlignment)

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

Sets how to handle content which overflows the bound of the LayoutElementBuilders.Spannable element. A LayoutElementBuilders.Spannable 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 content, the content which cannot fit inside its container will be truncated. If not defined, defaults to TEXT_OVERFLOW_TRUNCATE.

public LayoutElementBuilders.Spannable.Builder setOverflow(int overflow)

Sets how to handle content which overflows the bound of the LayoutElementBuilders.Spannable element. A LayoutElementBuilders.Spannable 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 content, the content 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.

public LayoutElementBuilders.Spannable.Builder setMarqueeIterations(int marqueeIterations)

Sets the number of times to repeat the Marquee animation. Only applies when overflow is TEXT_OVERFLOW_MARQUEE. Set to -1 to repeat indefinitely. Defaults to repeat indefinitely.