i need every 18,36,54,...18*Nth... grid with layout with width:match parent and height:60dp in grid layout manager for pagination loadingbar purpose.
Here is my code,
GridLayoutManager mng_layout = new GridLayoutManager(this, 4);//WHAT IS 4 ?//
mng_layout.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
int mod = position % 6; //WHAT IS 6 ?//
if (position == 0 || position == 1)
return 2; //WHAT IS 2 ?//
else if (position < 6)
return 1; //WHAT IS 1 ?//
else if (mod == 0 || mod == 1)
return 2; //WHAT IS 2 ?//
else
return 1; //WHAT IS 1 ?//
}
});
if anybody have a time please explain commented line in code