Pavel Marchenko
11/13/2020, 1:45 PMZach Klippenstein (he/him) [MOD]
11/13/2020, 3:42 PMText
overload that takes an AnnotatedString
, and then you can customize lineHeight
as much as you want using `ParagraphStyle`sPavel Marchenko
11/13/2020, 3:56 PMAnnotatedString
with SpanStyle
and ParagraphStyle
. The problem I'm trying to solve is illustrated on the screenshot below. I was able to achieve '1' variation, but I have a problem achieving variation '2'. I have tried few different approaches, and seems that I'm stuck at the moment.
I'm setting different bg color using SpanStyle
but it is applied to the whole line height, so my idea was to decrease line height for highlighted keywords but seems that it is not possible with SpanStyle
and ParagraphStyle
is not an option as it will introduce a line breakZach Klippenstein (he/him) [MOD]
11/13/2020, 4:08 PMTextLayoutResult
from the Text
composable, calculate the positions of the words you care about, then draw the backgrounds yourself so you have full control.