title: Align single item to center in RecyclerView android
body: <blockquote>
    <p>Suppose I have one OR two items in <code>RecyclerView</code> . How could I display them in <strong>center</strong> 
     <strong>RecyclerView must have width and height is match_parent</strong></p>
  </blockquote>
  
  <p><strong>AFAIK</strong> <code>recyclerView</code> starts from <code>top</code>. How could I give <code>gravity = center</code> to its <code>single item</code>. I mean if only 1 item comes it should be in the center of screen.
  <strong>RecylerView</strong> doesn't have <code>gravity attribute</code>. Is there any other way round. </p>
  
  <p>I can't set it's height to wrap_content. Because I also have to add a swipeRefreshLayout.</p>
  
  <p><strong>layout.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      style="@style/MatchMatch"
      android:background="@color/theme_color_gift_finder"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical"&gt;
  
          &lt;android.support.v4.widget.SwipeRefreshLayout
              android:id="@+id/activity_main_swipe_refresh_layout"
              android:layout_width="match_parent"
              android:layout_height="0dp"
              android:layout_weight="1"&gt;
  
              &lt;android.support.v7.widget.RecyclerView
                  android:id="@+id/rv_gift_menu"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:padding="@dimen/margin_pad_10" /&gt;
  
          &lt;/android.support.v4.widget.SwipeRefreshLayout&gt;
  
          &lt;LinearLayout
              android:id="@+id/ll_bottom"
              style="@style/LinearHorizontal"
              android:layout_marginBottom="@dimen/margin_pad_16"
              android:background="@android:color/transparent"
              android:gravity="center"&gt;
  
              &lt;com.netsolace.efc.utility.customviews.widgets.CustomButton
                  android:id="@+id/btn_go"
                  android:layout_width="@dimen/circular_go_n_done_btn_size"
                  android:layout_height="@dimen/circular_go_n_done_btn_size"
                  android:background="@drawable/oval_generic"
                  android:text="@string/go"
                  android:textColor="@color/theme_color_gift_finder"
                  android:textSize="@dimen/text_size_medium" /&gt;
  
          &lt;/LinearLayout&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;com.netsolace.efc.utility.customviews.widgets.CustomTextView
          android:id="@+id/tv_gift_no_result"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:gravity="center"
          android:text="No Results"
          android:textColor="@android:color/white"
          android:textSize="@dimen/text_size_large"
          android:textStyle="bold"
          android:visibility="gone" /&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>