title: Center a CardView in a RecyclerView with only one element
body: <p>I'm using a RecyclerView that contains CardViews with a TextView and a ImageView (Every card represents a city). I also have a onClickListener on every card that leads me to a list of museum in the city. (The RecyclerView is populated by an ArrayList). 
  The list is a RecyclerView composed by the same Cardview that scrolls vertically.</p>
  
  <p>When a city has only one museum, how can I display the unique CardView at the center of the screen?</p>
  
  <p>This is the activity xml:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context="com.bebbo203.mymuseum.MuseumActivity"&gt;
  
      &lt;android.support.v7.widget.RecyclerView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:id="@+id/recyclerViewMuseum"
          android:scrollbars="vertical"
          android:scrollIndicators="none"
          android:gravity="center_horizontal"
          /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>And this is the RecyclerView xml:</p>
  
  <pre><code> &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:baselineAligned="false"
                xmlns:card_view="http://schemas.android.com/apk/res-auto"&gt;
  
      &lt;android.support.v7.widget.CardView
          xmlns:card_view="http://schemas.android.com/apk/res-auto"
          android:layout_width="match_parent"
          android:layout_height="150dp"
          android:id="@+id/cardView"
          card_view:cardCornerRadius="2dp"
          card_view:cardUseCompatPadding="true"
          android:gravity="center_horizontal"
          android:animateLayoutChanges="true"
          &gt;
          &lt;FrameLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"&gt;
  
              &lt;ImageView
                  android:layout_width="match_parent"
                  android:layout_height="150dp"
                  android:id="@+id/imageViewList"
                  android:layout_gravity="center_horizontal|top"
                  android:adjustViewBounds="true"
                  android:scaleType="centerCrop"/&gt;
  
              &lt;TextView
                  android:id="@+id/textViewList"
                  android:layout_width="match_parent"
                  android:layout_height="150dp"
                  android:textSize="40sp"
                  android:textIsSelectable="false"
                  android:textAlignment="center"
                  android:gravity="fill"
                  android:textStyle="bold"
                  android:layout_weight="1"
                  android:layout_gravity="center_horizontal|top"/&gt;
  
          &lt;/FrameLayout&gt;
  
      &lt;/android.support.v7.widget.CardView&gt;
  
  
  &lt;/RelativeLayout&gt;`
  </code></pre>
  
  <p>Thanks for helping.</p>
  
  <p>So this is the MainActivity. A list of Cities. All is good here.
  <a href="https://i.stack.imgur.com/6d3x0.jpg"><img src="https://i.stack.imgur.com/6d3x0.jpg" alt="enter image description here"></a></p>
  
  <p>When I click on Parigi that has only one museum I wanted to show the single cardview at the center of the screen</p>
  
  <p><a href="https://i.stack.imgur.com/u57gD.jpg"><img src="https://i.stack.imgur.com/u57gD.jpg" alt="enter image description here"></a></p>
  
  <p>(And if it's possible i would like to make the cardview starting from the center of the screen, not from the top. Like if the central cardview is always at the center when I open the activity. For example translating NationalGallery at the center mantaining the order of the other)</p>
  
  <p><a href="https://i.stack.imgur.com/dUTAg.jpg"><img src="https://i.stack.imgur.com/dUTAg.jpg" alt="enter image description here"></a></p>