https://kotlinlang.org logo
#compose
Title
# compose
d

dzaitsev

11/27/2020, 5:57 PM
Hi everybody. In my app, I need to display a Privacy Notice stored in an HTML file. On Android I can do smth like
Copy code
policyView.text = HtmlCompat.fromHtml(htmlText, HtmlCompat.FROM_HTML_MODE_COMPACT)
How can I achieve the same result with
Text
from the compose library?
s

Siyamed

11/27/2020, 6:23 PM
Text doesn't have it. You will have to convert that spannable into an annotated string
I suspect that we will ever have html to text/annotated string conversion.
d

dzaitsev

11/27/2020, 7:21 PM
Well, yes. I was sure I need a conversion to annotated string, but hoped that such a function already exists.
s

Siyamed

11/27/2020, 7:22 PM
What we plan is to provide one from spannable to annotated, and vice versa. But not html for now.
👍 1
3 Views