How to make 4 CardView using RelativeLayout , which resize and occupy 25% of the screen, regardless of filling
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:orientation="vertical" android:padding="@dimen/padding_all"> <android.support.v7.widget.CardView android:id="@+id/understockCard" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="@dimen/card_margin" android:layout_weight="0.5" card_view:cardCornerRadius="@dimen/overview_cards_corner_radius" card_view:cardElevation="@dimen/overview_cards_cardElevation" card_view:contentPadding="@dimen/overview_cards_contentPadding"> <TextView android:id="@+id/t1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="UNDERSTOCK" android:textAppearance="?android:attr/textAppearanceLarge" /> </android.support.v7.widget.CardView> <android.support.v7.widget.CardView android:id="@+id/nearReorderCard" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="@dimen/card_margin" android:layout_weight="0.5" android:layout_toRightOf="@+id/understockCard" card_view:cardCornerRadius="@dimen/overview_cards_corner_radius" card_view:cardElevation="@dimen/overview_cards_cardElevation" card_view:contentPadding="@dimen/overview_cards_contentPadding"> <TextView android:id="@+id/t12" android:layout_width="100dp" android:layout_height="wrap_content" android:text="NEAR REORDER" android:textAppearance="?android:attr/textAppearanceLarge" /> </android.support.v7.widget.CardView> <android.support.v7.widget.CardView android:id="@+id/properLevelsCard" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="@dimen/card_margin" android:layout_weight="0.5" android:layout_below="@+id/understockCard" card_view:cardCornerRadius="@dimen/overview_cards_corner_radius" card_view:cardElevation="@dimen/overview_cards_cardElevation" card_view:contentPadding="@dimen/overview_cards_contentPadding"> <TextView android:id="@+id/t3" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="PROPER LEVELS" android:textAppearance="?android:attr/textAppearanceLarge" /> </android.support.v7.widget.CardView> <android.support.v7.widget.CardView android:id="@+id/overstockCard" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="@dimen/card_margin" android:layout_weight="0.5" android:layout_below="@+id/nearReorderCard" android:layout_toRightOf="@+id/properLevelsCard" card_view:cardCornerRadius="@dimen/overview_cards_corner_radius" card_view:cardElevation="@dimen/overview_cards_cardElevation" card_view:contentPadding="@dimen/overview_cards_contentPadding"> <TextView android:id="@+id/t4" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="OVERSTOCK" android:textAppearance="?android:attr/textAppearanceLarge" /> </android.support.v7.widget.CardView> </RelativeLayout> 