You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 26, 2019. It is now read-only.
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.
The text was updated successfully, but these errors were encountered:
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.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The text was updated successfully, but these errors were encountered: