I think the right way to achieve the goal described in the attached image would be GridLayoutManagerto use RecyclerView.LayoutManageror instead of using LinearLayoutManager.
LayoutManagerthat we attach to RecyclerViewdetermines the number of columns. There are 3 subclasses.
LinearLayoutManagerGridLayoutmangerStaggeredGridLayoutmanger
, RecyclerView.LayoutManager,
RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManger(this);
GridLayoutManager mLayoutManager = new GridLayoutManger(this, 2);
2 . , , , 2 .