🌈 Create new beautiful Compose Gradients with our new wesite ->
Interface

AnnotatedString.Annotation

Defines annotations that specify additional information to apply to ranges of text within the given AnnotatedString.

Source set: Common
public sealed interface Annotation

Defines annotations that specify additional information to apply to ranges of text within the given AnnotatedString.

The AnnotatedString supports annotations that provide different kind of information, such as

  • SpanStyle specifies character level styling such as color, font, letter spacing etc.
  • aligning, text direction etc.

  • ParagraphStyle for configuring styling on a paragraph level such as line heights, text
  • LinkAnnotation to mark links in the text.
  • TtsAnnotation provides information to assistive technologies such as screen readers.
  • Custom annotations using the StringAnnotation.

Members

Companion

Source set: Common
public companion object

Properties

Saver

Source set: Common
public val Saver: Saver<Annotation, Any> = AnnotationSaver

Saves and restores AnnotatedString.Annotation objects.

Supports the following annotation types:

Note: Does not preserve LinkInteractionListener of LinkAnnotations, and Bullet annotations are not preserved at the moment. Handle saving and restoring them manually if required.