title: CardView wrapping
body: <p>I have a card view in my application (using the support libraries) and I want the cards to wrap around if they don't all fit in one row. Currently, they are just stacking vertically. Is there a way to make them not only wrap, but also to fill the whole parent if they're the only element in the list?</p>
  
  <p>Ideally I would like two cards per row and then for them to wrap at that point to a new line.</p>
  
  <p>View containing the recyclerview:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/my_rootlayout"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"&gt;
  
  &lt;LinearLayout
      android:id="@+id/my_window"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_centerInParent="true"
      android:orientation="vertical"&gt;
  
      &lt;TextView
          android:id="@+id/my_headertext"
          style="@style/roboto_header_text_black"
          android:layout_width="wrap_content"
          android:layout_height="0dp"
          android:layout_centerHorizontal="true"
          android:layout_gravity="center_horizontal"
          android:layout_weight=".15"
          android:gravity="center"
          android:padding="@dimen/device_padding"
          android:text="@string/en_us_my_header"
          android:textIsSelectable="false" /&gt;
  
      &lt;android.support.v7.widget.RecyclerView
          android:id="@+id/my_list"
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_weight=".85"
  
          /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>CardView:</p>
  
  <pre><code>&lt;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:layout_width="250dp"
  android:layout_height="wrap_content"
  android:orientation="vertical"
  card_view:cardCornerRadius="2dp"&gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_weight="1"
      android:orientation="vertical"&gt;
  &lt;RelativeLayout
      android:layout_width="match_parent"
      android:layout_height="200dp"
      android:orientation="horizontal"&gt;
  
      &lt;ImageView
          android:id="@+id/image_thumbnail"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_centerHorizontal="true"
          android:gravity="center"
          android:src="@drawable/default_image"
          android:scaleType="centerCrop"
          android:adjustViewBounds="true" /&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="40dp"
          android:orientation="horizontal"
          android:layout_alignParentBottom="true"
          android:layout_alignParentStart="true"
          android:background="#99000000"
          android:gravity="center_vertical"
          android:paddingLeft="8dp"&gt;
  
          &lt;TextView
              android:id="@+id/my_listitem_title_text"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:singleLine="true"
              android:text="This is my title"
              android:textColor="@color/white"
              android:textSize="20sp"
              android:fontFamily="sans-serif-light"
              android:paddingLeft="8dp"
              android:paddingRight="8dp"
              android:paddingTop="4dp"
              android:paddingBottom="4dp" /&gt;
  
      &lt;/LinearLayout&gt;
  &lt;/RelativeLayout&gt;
  
      &lt;ProgressBar
          android:layout_width="match_parent"
          android:layout_height="8dp"
          android:indeterminate="false"
          style="?android:progressBarStyleHorizontal"
          android:progress="45" /&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="horizontal"
          android:paddingLeft="8dp"
          android:paddingRight="8dp"
          android:paddingTop="2dp"
          android:paddingBottom="2dp"&gt;
      &lt;TextView
          android:id="@+id/code_text_block"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textColor="@color/black"
          android:textSize="14sp"
          android:text="ABC" /&gt;
  
      &lt;TextView
      android:id="@+id/my_listitem_id_text"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="#123456"
          android:textColor="@color/black"
      android:layout_marginLeft="8dp" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;TextView
          android:id="@+id/my_listitem_date_text"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:textSize="14sp"
          android:paddingLeft="8dp"
          android:paddingRight="8dp"
          android:paddingTop="2dp"
          android:paddingBottom="2dp"
          android:text="Nov 5 - Nov 12, 2016"
          android:textColor="#7D7D7D" /&gt;
  
      &lt;LinearLayout
          android:orientation="horizontal"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:paddingLeft="8dp"
          android:paddingRight="8dp"
          android:paddingTop="4dp"
          android:paddingBottom="4dp"&gt;
  
          &lt;Button
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Download"
              android:textAllCaps="true"
              android:fontFamily="sans-serif"
              android:textStyle="bold"
              android:id="@+id/download_button"
              android:background="@color/white"
              android:textColor="@color/black"
              android:paddingLeft="4dp"
              android:paddingRight="4dp"
              android:paddingTop="8dp"
              android:paddingBottom="8dp" /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>