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
The easy change to allow us use this library wit GridLayoutManager is just to set "ViewType" public, currently they are private.
With this we can just add to the GridLayoutManager a SpanSizeLookup and set the correct span for header views.
I'm using 1 as section type based on the code, but would be nicce to have it "exposed" as a public constant. So we can use it something like this
layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
switch (adapter.getItemViewType(position)) {
case 1: // Section type, harcoded number because is not exposed by the api
return 2; //current span count
default:
return 1;
}
}
});
I have used this library well with linear layout manager, but gridlayout manager is not working well for span
Please give a solution
The text was updated successfully, but these errors were encountered: