Function

withStyle

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

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free

withStyle

Common
inline fun <R : Any> Builder.withStyle(style: SpanStyle, block: Builder.() -> R): R

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

Parameters

style SpanStyle to be applied
block function to be executed

Returns

result of the block

withStyle

Common
inline fun <R : Any> Builder.withStyle(
    style: ParagraphStyle,
    crossinline block: Builder.() -> R,
): R

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

Parameters

style SpanStyle to be applied
block function to be executed

Returns

result of the block