Is there a way to force line height ?
Hello here.
I tried to force the line height in the case of a vertical spanned grid recycler view. On creating the ViewHolder, I set a new SpanLayoutParams with a computed height (here we try to have a specific number of line matching the recycler height).
But items are drawn with a height matching the width of a one-span-sized item.
Is there a way to achieve this with this SpannedGridLayoutManager ?
Thanks by advance.
Edit: just to know, the same methos of forcing items line height works fine with a classic GridLayoutManager.
Any updates on this?
Same here. I have RV items with different layout files and different heights. But the height always seems to be the width of a column!?
The issue with allowing custom heights - besides making the layouting algorithm more complex - is again the ordering used by the layout manager and failing at the problem it's trying to solve: placing all the items in the RV leaving as few gaps as possible.
One example would be this:

As the 3rd item is slightly taller than the rest of its row, it will affect all items below it and leave those 2 gaps there, that will probably never be filled. The more the items differ in width and heights, the more gaps will appear and the ordering will be affected.
As @prouland suggested, to prevent this the line or row height could be set to custom heights, instead of the items. Again, this would make the algorithm a lot more complex and require a big rewrite, which I can't do at the moment as I don't have the time.