AnnotatedString

data class AnnotatedString
kotlin.Any
   ↳ androidx.ui.text.AnnotatedString

The basic data structure of text with multiple styles. To construct an AnnotatedString you can use Builder.

Summary

Nested classes

Builder class for AnnotatedString.

data

The information attached on the text such as a SpanStyle.

Public constructors

<init>(text: String, spanStyles: List<SpanStyleItem> = listOf(), paragraphStyles: List<ParagraphStyleItem> = listOf())

The basic data structure of text with multiple styles.

Public methods

operator AnnotatedString

Extension functions

From androidx.ui.text
AnnotatedString
AnnotatedString.capitalize(localeList: LocaleList = LocaleList.current)

Create capitalized AnnotatedString

AnnotatedString
AnnotatedString.decapitalize(localeList: LocaleList = LocaleList.current)

Create capitalized AnnotatedString

AnnotatedString

Return a substring for the AnnotatedString and include the styles in the range of start (inclusive) and end (exclusive).

AnnotatedString
AnnotatedString.toLowerCase(localeList: LocaleList = LocaleList.current)

Create lower case transformed AnnotatedString

AnnotatedString
AnnotatedString.toUpperCase(localeList: LocaleList = LocaleList.current)

Create upper case transformed AnnotatedString

Inherited extension functions

From androidx.compose
operator T

IMPORTANT: This global operator is TEMPORARY, and should be removed whenever an answer for contextual composers is reached.

Properties

List<ParagraphStyleItem>

List<SpanStyleItem>

String

Extension properties

From androidx.ui.text
Int

Returns the length of the AnnotatedString.

Public constructors

<init>

AnnotatedString(
    text: String,
    spanStyles: List<SpanStyleItem> = listOf(),
    paragraphStyles: List<ParagraphStyleItem> = listOf())

The basic data structure of text with multiple styles. To construct an AnnotatedString you can use Builder.

Public methods

plus

operator fun plus(other: AnnotatedString): AnnotatedString

Properties

paragraphStyles

val paragraphStyles: List<ParagraphStyleItem>

spanStyles

val spanStyles: List<SpanStyleItem>

text

val text: String