I'm looking to create a music app and I'd like to make a GridView
similar to what Google Play uses where they inject elements that will span rows and columns like the Soilwork album does in this screenshot:
I've thought about using a ListView
and populating rows with custom elements, but I couldn't think of a good way to use that with ViewHolder pattern, or really a way to make that reusable and account for differing number of items in width based on screen size (for example, the grid is only two items wide on phones, and "large" items span both columns and only one row).
I've also thought about using a ScrollView
filled with custom ViewGroup
s, but that seems to run into the same issues I previously mentioned.
I next thought about using GridLayout
, but that doesn't accept ListAdapter
s, and doesn't seem tuned to the kind of usage I'm looking at (nor does it seem to scroll)
I'd greatly appreciate if anyone could give me somewhere to start on this, or could point me to a library that does this. I've already checked out StaggeredGridView but it doesn't seem to accomplish what I'd like. My ideal solution would be a view which lays out items on an even grid like GridView
and accepts view from a ListAdapter
, also like GridView
, but allow for elements to span, using the single cell constraint of GridView
as the default behaviour.
Cheers.
EDIT
I have a perfectly functioning GridView
as shown below, but I'd like to make items at regular intervals (every n
th item) span more than one column and/or row, as shown in the previous screenshot.
Check out Parchment. GridDefinitionView may help you achieve the UI you are looking to build.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With