I am actually using a GridLayoutManager with two columns in my app and I would like to have one column depending on the view type used.
Here is the code I have in the me
mGridLayoutManager = new GridLayoutManager(mContext, 2);
mGridLayoutManager.setSpanSizeLookup(onSpanSizeLookup);
/**
* Helper class to set span size for grid items based on orientation and device type
*/
GridLayoutManager.SpanSizeLookup onSpanSizeLookup = new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
return mHomeListAdapter.getItemViewType(position) == TYPE_PREMIUM ? 2 : 1;
}
};