I have a list contains items included different categories. For example, i have 4 lists and i merge them like this:
list1 = A,A,A,A
list2 = B,B,B,B
list3 = C,C,C,C
list4 = D,D,D,D
i merge these like this:
mergedList=A,B,C,D,A,B,C,D,A,B,C,D,A,B,C,D
All list items might have different size and i want to locate all A items to first span, B items second span and the same for C-D items...
But items are always located in different spans. Because item sizes are different and some items are created after small size items, not in next span. Is there any way to fix this problem with StaggeredGridLayoutManager?
I have fixed the problem. StaggeredGridLayoutManager adds next item to smallest span everytime. You should claculate span widths and pick item from matched list.