https://kotlinlang.org logo
#compose
Title
# compose
r

Rafs

09/27/2023, 4:01 PM
I have a layout structure where the parent container has
animateContentSize
and the child has
fillMaxHeight
but when the parent container's size changes dynamically, the child isn't resizing to fill the whole height. Is this expected behaviour or is it a bug, because I would expect the child to
fillMaxHeight
always
p

Pablichjenkov

09/27/2023, 4:43 PM
I would expect the same. What happens if you use a box instead of a card?
r

Rafs

09/27/2023, 4:46 PM
It's the same results with a box as well
I can get the height of the parent container from
onSizeChanged
and use it to set the height of the child but what happens afterwards is that the child prevents the parent from shrinking again.
p

Pablichjenkov

09/27/2023, 4:50 PM
Yeah you could do things like that but there is an actual type of animation that works on the layout modifying it. Is in the official documentation
Bottomline is that some animations don't modify the actual layout to not trigger re-mesurement and re-layout but there is a way to force that. Let me see if I find it
👍 1
r

Rafs

09/27/2023, 4:55 PM
In my situation I guess that's what I want, to force recomposition for the child container to be laid out again. Currently it is out of sync with the parent and not filling the max height like I want it to be