Hello! How can I achive this behavior? A card (o...
# compose
a
Hello! How can I achive this behavior? A card (or smthing) that expand vertically without affecting the rest of layout. I tried with zIndex on the card but still moving the layout around
m
i would bet the expanded card is actually in a box
a
It even expands the rest of layout. I have those cards in a LazyVerticalGrid (two rows of three cards)
e
It's a popup menu. You can overlay a popup on the item itself and then it'll seem as of it's the item that is expanding
a
Those show a different window with content. Wait a moment i will be at laptop to show it
e
Yeah dropdown menu not popup menu (i dunno, anyone should work)
a
What do you mean by overlay on the item itself?
e
instead of making the item itself grow, put a popup (with the same header) above it
the popup doesn't affect layout, and has other benefits like dismissing if the user touches outside of it
a
Uhmm, could work
The idea is good, but how Can I make the popup march the card width?
e
Copy code
var width by remember { mutableStateOf(0) }
Card(modifier = Modifier.onSizeChanged { width = it.width })
DropdownMenu(modifier = Modifier.sizeIn(minWidth = with(LocalDensity.current) { width.toDp() })
m
Or just make a custom layout that ignores the height of that composable