1

enter image description hereunable to create grid view with wrap_content height or how to create Different Columns Sizes Grid View in android

3 Answers3

1

You might try the StaggeredGridLayoutManager in combination with a RecyclerView

https://developer.android.com/reference/android/support/v7/widget/StaggeredGridLayoutManager.html

ligi
  • 39,001
  • 44
  • 144
  • 244
0

You need GridLayout, because RecyclerView + StaggeredGridLayoutManager allows only different size of items' height, but all columns will have size of maximum item width, so smaller items will be aligned inside column. Check my answer from here: https://stackoverflow.com/a/36110913/4288054

Community
  • 1
  • 1
Oleksandr Albul
  • 1,611
  • 1
  • 23
  • 31
0

https://drive.google.com/file/d/1AyLqj2aPNNrA80USlJ4mzCD3V8U2zczj/view?usp=sharing

I have made an asymmetric layout in android programmatically because its an easy way to manage all things.

please see the code link have attached in also visit video after I have created the view we gain the above video output

code link - https://gist.github.com/axarlotwala/bd987cf9a39303b0bd3ea1406e477ef7

please vote Up and subscribe for new unique thing and please vote my code

axar
  • 539
  • 2
  • 17