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
It's the wanted behavior, I'm quoting the documentation of DividerBuilder.visibilityProvider:
IMPORTANT: The default [DividerOffsetProvider] can't ensure the same size of the items in a grid when this method is called.
If you want a different behavior, you can specify a custom [DividerOffsetProvider] with [offsetProvider].
The auto sizing of the cells with a GridLayoutManager is not supported with VisibilityProvider and SizeProvider, you have two choices:
use the non-provider API e.g. size(), showFirstDivider(), etc..
use the provider API and add a DividerOffsetProvider handling the sizing by yourself
BTW your implementation above can be made in this way and the cells will be autosized:
In my project , the complex divide is required,so I have to use the size and visiblity provider.
I will try to use DividerOffsetProvider to handle the sizing of each cell.
BYW,The divider library, it is very helpful,thank you a lot.
Description
With multiple columns,the cell in middle column is bigger than the sidles.
RecyclerViewDivider version:
version:
3.3.0
API level:
How to reproduce it:
Use
GridLayoutManager
with VERTICALspanCount
is 3add the divider as the follwing sample code
as the uppper steps ,it will reporduce.
remove
visibilityProvider
method,it works fine.Sample code:
Stack trace:
The text was updated successfully, but these errors were encountered: