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

David W

01/09/2022, 6:16 AM
Any suggestions on how to add a full-width horizontal divider to a
LazyVerticalGrid
with adaptive cells? I searched here and google, but there weren't any solutions. edit: all set, came up with a different solution.
Copy code
LazyVerticalGrid(
    horizontalArrangement = Arrangement.spacedBy(16.dp),
    verticalArrangement = Arrangement.spacedBy(16.dp),
    cells = GridCells.Adaptive(370.dp)
)
is my grid code
Essentially, I want to break the grid into sections.
The only idea I can really think of is basically homerolling my own grid using a LazyColumn, which means having to calculate the right number of cells to place in each Row 😐
Alternatively, if I can figure out how to get the number of columns being shown, I can create the correct number of empty cells to form the rest of a row + a new row as a mock divider.
but that info doesn't appear to be exposed
I ended up simply splitting it into two grids and putting them side by side. works, and arguably a better UX in my specific case
9 Views