When switching two widgets in a Box with AnimatedV...
# compose
a
When switching two widgets in a Box with AnimatedVisibility (only one visible at a time), is there any way of having the Box size equal to the largest widget? I could make it work by animating alphas instead, but this looks a bit hacky.
s
Do you know for a fact which one of the two is gonna be bigger? If yes, I'd place that one in the other case where it isn't supposed to show with a modifier which does measure it but does not place it. If you don't know, I'd just do both in both cases. You probably don't want to animate alphas as the item is still going to be present and focusable for accessibility services
a
Do you have an example of such a modifier?
a
Thanks, I will try that!