Hi, How Can I animate a `Text` between two `TextS...
# compose
m
Hi, How Can I animate a
Text
between two
TextStyle
?
m
recently I animated
fontSize
and color together:
Copy code
val transition = updateTransition(targetState = isSelected, label = "")
    val color by transition.animateColor { selected ->
        if (selected) Color.Black else Color.LightGray
    }
    val fontSize by transition.animateInt { selected ->
        if (selected) 24 else 16
    }
Text(
            text = label,
            fontSize = fontSize.sp,
            color = color,
        )
something like this
maybe that can help you
OR you can maybe use
AnimatedContent
with and define some custom animation
m
thanks, any idea how to animate beween two material typography?
m
AnimatedContent
is the only thing that comes to mind right now
or you can create your own custom animation and provide
Copy code
TwoWayConverter
am not aware of that exiting out of the box