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

fromHtml

Converts a string with HTML tags into AnnotatedString.

AnnotatedStringFromHtml

@Composable
@Sampled
fun AnnotatedStringFromHtml() {
    // First, download a string as a plain text using one of the resources' methods. At this stage
    // you will be handling plurals and formatted strings in needed. Moreover, the string will be
    // resolved with respect to the current locale and available translations.
    val string = stringResource(id = R.string.example)

    // Next, convert a string marked with HTML tags into AnnotatedString to be displayed by Text
    val styledAnnotatedString = AnnotatedString.fromHtml(htmlString = string)

    BasicText(styledAnnotatedString)
}

Content updated: