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

withAnnotation

Pushes an annotation to the AnnotatedString.Builder, executes block and then pops the annotation.

withAnnotation

Source set: Common
public inline fun <R : Any> Builder.withAnnotation(
    tag: String,
    annotation: String,
    crossinline block: Builder.() -> R,
): R

Pushes an annotation to the AnnotatedString.Builder, executes block and then pops the annotation.

Parameters

tag the tag used to distinguish annotations
annotation the string annotation attached on this AnnotatedString
block function to be executed

Return

result of the block

withAnnotation

Source set: Common
public inline fun <R : Any> Builder.withAnnotation(
    ttsAnnotation: TtsAnnotation,
    crossinline block: Builder.() -> R,
): R

Pushes an TtsAnnotation to the AnnotatedString.Builder, executes block and then pops the annotation.

Parameters

ttsAnnotation an object that stores text to speech metadata that intended for the TTS engine.
block function to be executed

Return

result of the block

withAnnotation

Source set: Common
@Deprecated("Use LinkAnnotation API for links instead", ReplaceWith("withLink(, block)"))
public inline fun <R : Any> Builder.withAnnotation(
    urlAnnotation: UrlAnnotation,
    crossinline block: Builder.() -> R,
): R

Pushes an UrlAnnotation to the AnnotatedString.Builder, executes block and then pops the annotation.

Parameters

urlAnnotation A UrlAnnotation object that stores the URL being linked to.
block function to be executed

Return

result of the block