TextSpan

class TextSpan
kotlin.Any
   ↳ androidx.ui.text.TextSpan

A TextSpan object can be styled using its style property. The style will be applied to the text and the children.

For the object to be useful, at least one of text or children should be set.

Summary

Public constructors

<init>(style: TextStyle? = null, text: String? = null, children: MutableList<TextSpan> = mutableListOf())

A TextSpan object can be styled using its style property.

Public methods

String

Extension functions

From androidx.ui.text
AnnotatedString

Convert a TextSpan into an AnnotatedString.

Properties

MutableList<TextSpan>

Additional spans to include as children.

TextStyle?

The style to apply to the text and the children.

String?

The text contained in the span.

Public constructors

<init>

TextSpan(
    style: TextStyle? = null,
    text: String? = null,
    children: MutableList<TextSpan> = mutableListOf())

A TextSpan object can be styled using its style property. The style will be applied to the text and the children.

For the object to be useful, at least one of text or children should be set.

Parameters
style: TextStyle? = null The style to apply to the text and the children.
text: String? = null The text contained in the span. If both text and children are non-null, the text will precede the children.
children: MutableList<TextSpan> = mutableListOf() Additional spans to include as children. If both text and children are non-null, the text will precede the children. The list must not contain any nulls.

Public methods

toString

fun toString(): String

Properties

children

val children: MutableList<TextSpan>

Additional spans to include as children. If both text and children are non-null, the text will precede the children. The list must not contain any nulls.

style

val style: TextStyle?

The style to apply to the text and the children.

text

val text: String?

The text contained in the span. If both text and children are non-null, the text will precede the children.