title: CardView aligning inside RecyclerView
body: <p>I'm using <code>RecyclerView</code> with <code>LinearLayoutManager</code>, items are <code>CardViews</code>. All cards have fixed (in pixels) width. RecyclerView is placed inside <code>SwipeRefreshLayout</code>, if that matters. </p>
  
  <p>How to horizontally align each <code>RecyclerView</code> item using only xml? Applying <code>android:layout_gravity="center"</code> to cards have no effect.</p>
  
  <p>Part with the RecyclerView:</p>
  
  <pre><code>&lt;android.support.v4.widget.SwipeRefreshLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/swipe_container"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;android.support.v7.widget.RecyclerView
          android:id="@+id/news_recycler_view"
          android:paddingTop="16dp"
          android:paddingBottom="16dp"
          android:clipToPadding="false"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"/&gt;
  
  &lt;/android.support.v4.widget.SwipeRefreshLayout&gt;
  </code></pre>
  
  <p>Card layout:</p>
  
  <pre><code>&lt;android.support.v7.widget.CardView
      xmlns:card_view="http://schemas.android.com/apk/res-auto"
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/card_view"
      android:layout_height="wrap_content"
      style="@style/CardStyle"&gt;
  
      ...
  &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>
  
  <p>Style:</p>
  
  <pre><code>&lt;style name="CardStyle" parent="CardView.Light"&gt;
       ...
      &lt;item name="android:layout_marginBottom"&gt;8dp&lt;/item&gt;
      &lt;item name="android:layout_width"&gt;@dimen/cardview_width&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>