Data from the adapter is displayed using the GridLayoutManager.
MainActivity.java
private RecyclerView mRecyclerView; mRecyclerView = (RecyclerView) findViewById(R.id.list); mRecyclerView.setLayoutManager(new GridLayoutManager(this, 7)); main.xml
<android.support.v7.widget.RecyclerView android:id="@+id/list" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="8dp" android:clipToPadding="false"> </android.support.v7.widget.RecyclerView> In item.xml template for item
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:id="@+id/cv" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_centerHorizontal="true" card_view:cardCornerRadius="5dp" card_view:cardElevation="2dp" card_view:contentPadding="10dp"> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:text="@string/text" android:layout_centerVertical="true" android:textColor="@color/primary_text_default_material_light" android:textSize="16sp"/> </RelativeLayout> </android.support.v7.widget.CardView> If you write this way, then the cell will naturally stretch to fit the text, leaving a void at the bottom of the screen.
If you write android:layout_width="match_parent" , one cell will stretch to full screen.
Is it possible to make it so that all the cells fit on one screen and fill in all the spaces on the screen?

