Is there a neat way to animate the `weight` of an ...
# compose
c
Is there a neat way to animate the
weight
of an item in a
Column
down to 0? Seems a little tricky as weights must have a value greater than 0. Am I missing something?
d
Are you trying to remove the item by changing its
weight
to 0?
c
Yep
d
Can you replace the
weight(..)
modifier with:
animateContentSize().then(if(..) weight(...) else height(0.dp))
(Haven't tested this, but I suspect it might work). 😁
🙏🏼 1
c
Nailed it! Works perfectly for my use case, thanks @Doris Liu 🙏
👍 2
d
🤣 Nice!
184 Views