public final class

LayoutElementBuilders.Spannable

extends java.lang.Object

implements LayoutElementBuilders.LayoutElement

 java.lang.Object

↳androidx.wear.protolayout.LayoutElementBuilders.Spannable

Overview

A container of LayoutElementBuilders.Span elements. Currently, this supports LayoutElementBuilders.SpanImage and LayoutElementBuilders.SpanText elements, where each individual LayoutElementBuilders.Span can have different styling applied to it but the resulting text will flow naturally. This allows sections of a paragraph of text to have different styling applied to it, for example, making one or two words bold or italic.

Summary

Methods
public static LayoutElementBuilders.SpannablefromProto(LayoutElementProto.Spannable proto, Fingerprint fingerprint)

Creates a new wrapper instance from the proto.

public FingerprintgetFingerprint()

public DimensionBuilders.SpPropgetLineHeight()

Gets the explicit height between lines of text.

public intgetMarqueeIterations()

Gets the number of times to repeat the Marquee animation.

public TypeBuilders.Int32PropgetMaxLines()

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

public ModifiersBuilders.ModifiersgetModifiers()

Gets ModifiersBuilders.Modifiers for this element.

public LayoutElementBuilders.HorizontalAlignmentPropgetMultilineAlignment()

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

public LayoutElementBuilders.TextOverflowPropgetOverflow()

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

public java.util.List<LayoutElementBuilders.Span>getSpans()

Gets the LayoutElementBuilders.Span elements that form this LayoutElementBuilders.Spannable.

public LayoutElementProto.LayoutElementtoLayoutElementProto()

public java.lang.StringtoString()

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

Methods

public java.util.List<LayoutElementBuilders.Span> getSpans()

Gets the LayoutElementBuilders.Span elements that form this LayoutElementBuilders.Spannable.

public ModifiersBuilders.Modifiers getModifiers()

Gets ModifiersBuilders.Modifiers for this element.

public TypeBuilders.Int32Prop getMaxLines()

Gets 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.HorizontalAlignmentProp getMultilineAlignment()

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

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

public int getMarqueeIterations()

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

public Fingerprint getFingerprint()

Creates a new wrapper instance from the proto.

public LayoutElementProto.LayoutElement toLayoutElementProto()

public java.lang.String toString()