Search code examples
androidandroid-layoutandroid-gridlayoutgridlayoutmanager

How to make GridLayoutManager use dynamic spaces?


I am currently using a GridLayoutManager for a RecyclerView which displays Previews of different Articles, which have different text lengths and therefor different item heights. The question is, how can I use the full height and dont have too much spacing?

enter image description here


Solution

  • Use StaggeredGridLayoutManager! https://developer.android.com/reference/android/support/v7/widget/StaggeredGridLayoutManager