I spent many time looking for the solution How to do the Windows tiles liked interface, also knowing as Dashboard. I want use for it RecyclerView with CardView. I found old solution but there used LinearLayout with Buttons: How to create layout with 6 buttons like windows tiles
I have six CardViews, they should occupy the entire area of the parent RelativeLayout and be the same size regardless of the width of the screen.
In portrait mode I have 2 columns and in landscape - 3 cols.
recyclerView.setHasFixedSize(true);
int columns = resources.getConfiguration()
.orientation == Configuration.ORIENTATION_LANDSCAPE ? 3 : 2;
RecyclerView.LayoutManager mLayoutManager = new GridLayoutManager(getApplicationContext(), columns);
recyclerView.addItemDecoration(new GridSpacingItemDecoration(columns,
Utils.dpToPx(resources, 3), true));
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setLayoutManager(mLayoutManager);
How can I do that?