My Recycler Item which inflate in onCreateViewHolder
As of support library 25.1.0, ABOVE ANSWER DOESN'T WORK. I suggest below modifications:
public MyAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item, parent, false);
GridLayoutManager.LayoutParams lp = (GridLayoutManager.LayoutParams) v.getLayoutParams();
lp.height = parent.getMeasuredHeight() / 4;
v.setLayoutParams(lp);
return new ViewHolder(v);
}