skip to Main Content

I’ve been having fun digging into Jetpack Compose. Here I used Rows, Columns, and Spacers to build this screenshot. Is there a better-suited Composable I should try?

grid

I couldn’t get LazyVerticalGrid to place the jellyfish in its position. It wants to put it on the left beneath the black dog, which leaves a blank space and pushes the brown dogs onto their own line.

I also tried Accompanist’s FlowRow, which draws the same arrangement as LazyVerticalGrid. It’s also likely I’m not familiar enough with the API of either.

Later I want to learn drag & drop to reorder the items. Are there considerations to make as I’m setting up this widget to make life easier? In my head it seems like these individual Rows and Columns could get in my way, maybe it has no bearing though.

Thanks for any insights!

2

Answers


  1. Chosen as BEST ANSWER

    I made a custom Layout instead, which allows for measuring and placing content. 🤞🏽


  2. Google jetpack compose pathway has a lesson on custom layout, but i think you can use a Lazy Grid, it makes it easy to work with grids.

    Link android developers Lazy Grids
    if you click the lazy vertical grid link you’ll see that you can have multiple rows of items with different modifiers and number of grid cells.

    I would love to give you a working example, so I will probably edit this soon.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search