Hello everyone :wave: I'm trying to animate a Mat...
# compose
d
Hello everyone 👋 I'm trying to animate a Material
Chip
. I've been reading other messages and tried
animateContentSize()
,
AnimatedContent
and other ways with no luck and weird results. First I tried the
animateContentSize()
directly to the Chip's modifier but the animation seems not smooth and it only works for the selected state and not the other way around. Also tried adding
animateContentSize()
inside the
trailingIcon
with even a weirder result. Any ideas? 🙇
Maybe @Doris Liu could you help me here? I'd really appreciate it 🙇
d
Can you share your code snippet? Maybe that'll help us understand why
animateContentSize
didn't work.
d
Sure! this is the Composable code 🙂
d
Thanks for sharing the snippet. I'm not able to reproduce the strange text relayout effect with the snippet above. Though based on the videos, there seems to be some
Constraints
change during the measurement that causes the text (i.e. title of the chip) to be remeasured and relaid out, which is not desirable. If you could isolate the issue in a minimal reproducible project, that'd help us narrow down where the changing Constraints come from. It's possible that the constraints come from the use of
IntrinsicSize