withLink

Function

Common
inline fun <R : Any> Builder.withLink(link: LinkAnnotation, block: Builder.() -> R): R

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

Parameters

linkA LinkAnnotation object representing a clickable part of the text
blockfunction to be executed

Returns

result of the block