Melvin Biamont
03/09/2023, 7:40 PMval response = "Image <icon name='System/actionArrow' color='#FF0000'/> in the middle of the text"
Using HtmlCompat
and Spanned
, I’m converting this string into an AnnotatedString
(with appendInlineContent
).
Then, in my Text
, I pass the inlineContent
map with something like
mapOf(
"System/Forward" to InlineTextContent(...),
"System/Increase" to InlineTextContent(...),
(...)
)
And it works, I have inlined icons in my text 🙌 .
But I can’t tint the icons properly.
As inlineContent
is just a map ID -> InlineTextContent; I can’t pass the tint to the InlineTextContent
or I should add the tint to the inlineContent ID like this (which is ridiculous):
mapOf(
(...)
"System/Forward_#222222" to InlineTextContent(...),
"System/Forward_#333333" to InlineTextContent(...),
(...)
)
Any idea how I could pass more arguments to the inlineContent
than just its ID?
Couldn’t it be a function`(String) -> InlineTextContent?` instead of a map?