Folks . In compose LazyVerticalGrid using GridCel...
# android
b
Folks . In compose LazyVerticalGrid using GridCells.Adaptive , isn't the left over space distributed evenly ? For example , lets assume I have
Copy code
GridCells.Adaptive(100.dp)
and I am runnin the app which has the screen width of 350.dp . The compiler would identify that I can draw 3 columns , and 50dp would be left over . What would happen to the left over space ? I am unable to utilize the left over space evenly despite horizontalArrangement .
Copy code
LazyVerticalGrid(
    modifier = Modifier.fillMaxWidth().background(Color.Blue),
    horizontalArrangement = Arrangement.SpaceBetween,
    columns = GridCells.Adaptive(100.dp)
) {
    items(items) { room ->
        RoomItem(room)
    }
}

@Composable
fun RoomItem(room: RoomView) {
    Box(
        Modifier
            .fillMaxWidth() // Fills the width of the column
            .height(120.dp) // Give it a fixed height for visual clarity
            .background(Color.Green) // This is the column's actual area
            .padding(4.dp), // Some padding for visual separation
        contentAlignment = Alignment.Center
    ) {
       
        Text(text = "Room: ${room.name}", color = Color.White) // Just a placeholder
    }


}
The code above yields the result in the screenshot. All my items are stacked after each other and the remaining space just appears at the end .
c
You should move the question to #C04TPPEQKEJ
b
oh apologies , didn't know of that channel . ty