I am using GridLayoutManager with 2 cells and for some cells I want span to be one so I tried using setSpanSizeLookup but its not working. I tried returning span count 1 for all positions but still two cells are appearing instead of one.
Following is my code
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
return 1;
}
});
recyclerView.setLayoutManager(gridLayoutManager);
Any reasons why it is not working?