LayoutElementBuilders.Spannable

public final class LayoutElementBuilders.Spannable implements LayoutElementBuilders.LayoutElement


A container of Span elements. Currently, this only supports Text elements, where each individual 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

Public constructors

Public methods

@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 Spannable element.

@Nullable ModifiersBuilders.Modifiers

Gets androidx.wear.tiles.ModifiersBuilders.Modifiers for this element.

@Nullable LayoutElementBuilders.HorizontalAlignmentProp

Gets alignment of the Spannable content within its bounds.

@Nullable LayoutElementBuilders.TextOverflowProp

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

@NonNull List<LayoutElementBuilders.Span>

Gets the Span elements that form this Spannable.

Extension functions

final void

Clear all spans from this text.

final void
SpannableStringKt.set(
    Spannable receiver,
    int start,
    int end,
    Object span
)

Add span to the range start