Background
I have an application that displays a list of elements in a grid, but not exactly ...
Problem
Some elements have different heights, so those close to them should have the same height as theirs. This works on the GridLayoutManager.
Some elements (actually only the first in my case) should span the entire row (so I used the StaggeredGridLayoutManager).
Using a regular GridLayoutManager, the first requirement worked fine: each row could have a different height. But because of # 2, it actually destroyed # 1.
Question
Is it possible to use the StaggeredGridLayoutManager so that when the elements have different heights, they will not make them move along the Y coordinate?
I thought: maybe I could use NestedScrollView and the GridLayoutManager (because only the first element is stretched), but still I would like to know if this is possible in other cases (as well as this solution).
android android-recyclerview gridlayoutmanager
android developer Nov 16 '15 at 6:33 2015-11-16 06:33
source share