Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RecyclerView grid with different item sizes

I need to create a horizontal scrolling grid that can allocate items with different width and different height. StaggeredGridLayoutManager can handle different width but it won't let me have items with different height. Is there any LayoutManager implementation which can do what I need?

like image 485
Charlie-Blake Avatar asked Dec 05 '14 11:12

Charlie-Blake


1 Answers

Unfortunately, there's no LayoutManager for that yet. You'll have to implement you own LayoutManager from scratch. The currently available LayoutManagers (as of december 2014) are:

  1. LinearLayoutManager
  2. GridLayoutManager
  3. StaggeredGridLayoutManager

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

EDIT:

You can also look at this if you want to implement your LayoutManager in an easier way...

like image 86
mato Avatar answered Nov 20 '22 19:11

mato