title: RecyclerView GridLayoutAdapter - How to center items
body: <p>I am using RecyclerView with GridLayoutAdapter. Is it possible to center items horizontally or vertically?</p>
  
  <p>My item layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout 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:gravity="center"
                android:orientation="horizontal"&gt;
  
      &lt;ImageView
          android:id="@+id/item_photo_image_view"
          android:layout_width="@dimen/custom_photo_item_size"
          android:layout_height="@dimen/custom_photo_item_size"
          android:background="@drawable/custom_image_background"
          tools:src="@drawable/gallery_list_cars"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Actually it looks like this: <a href="http://oi61.tinypic.com/34pjmtc.jpg" rel="nofollow">http://oi61.tinypic.com/34pjmtc.jpg</a></p>
  
  <p>Desired layout should look like: <a href="http://oi62.tinypic.com/7e2t.jpg" rel="nofollow">http://oi62.tinypic.com/7e2t.jpg</a></p>
  
  <p>Setting RecyclerView to wrap_content does not work, it still uses all free space. I imagine it should be LayoutManager responsibility to setup children gravity within RecyclerView.</p>