Function

withStyle

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

withStyle

Source set: Common
public 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

Return

result of the block

withStyle

Source set: Common
public 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

Return

result of the block

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: