AnnotatedString
@Immutable class AnnotatedString : CharSequence
kotlin.Any | |
↳ | androidx.compose.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<AnnotatedString.Range<SpanStyle>> = listOf(), paragraphStyles: List<AnnotatedString.Range<ParagraphStyle>> = listOf()) The basic data structure of text with multiple styles. |
Public methods | |
---|---|
Boolean | |
operator Char | |
List<AnnotatedString.Range<String>> |
getStringAnnotations(tag: String, start: Int, end: Int) Query the string annotations attached on this AnnotatedString. |
List<AnnotatedString.Range<String>> |
getStringAnnotations(start: Int, end: Int) Query all of the string annotations attached on this AnnotatedString. |
List<AnnotatedString.Range<TtsAnnotation>> |
getTtsAnnotations(start: Int, end: Int) Query all of the string annotations attached on this AnnotatedString. |
Int |
hashCode() |
operator AnnotatedString |
plus(other: AnnotatedString) |
AnnotatedString |
subSequence(startIndex: Int, endIndex: Int) Return a substring for the AnnotatedString and include the styles in the range of startIndex (inclusive) and endIndex (exclusive). |
AnnotatedString |
subSequence(range: TextRange) Return a substring for the AnnotatedString and include the styles in the given range. |
String |
toString() |
Extension functions | ||||||||
---|---|---|---|---|---|---|---|---|
From androidx.compose.ui.text
|
Inherited extension functions | ||||||||
---|---|---|---|---|---|---|---|---|
From androidx.core.text.kotlin.CharSequence
|
||||||||
From androidx.compose.ui.text.kotlin.CharSequence
|