https://kotlinlang.org logo
Title
m

mertceyhan

05/08/2023, 6:58 PM
e

ephemient

05/08/2023, 9:35 PM
may truncate in the middle of glyphs (due to multi-surrogate codepoints, or combining characters, or emoji, or … lots of cases really)
plus it causes text re-measure on every step
IMO it would be better to measure the text only once and change the styling on each interval
like this, for example. less code, text layout happens once, animation is easily tweakable
AnimatedTextAppearance(
    text = AnnotatedString("Hello, world!"),
    animationSpec = tween(durationMillis = 2_000),
)