RecyclerView and Toolbar, can't scroll bottom item into view
<p><strong>EDIT:</strong> See <a href="https://stackoverflow.com/questions/35893187/using-the-master-detail-template-in-viewpager-fragments-download-link">Using the Master/Detail template in ViewPager Fragments (download link)</a> for full code</p>

<p>I have a toolbar and a <code>recyclerView</code>. When the layout is first inflated the last item of the <code>recyclerView</code> is out of the scroll-able region of the screen and is therefore not visible. After rotating the item appears. It is apparent that the toolbar is pushing the <code>recyclerView</code> outside the boundaries of the screen. If I add padding to the bottom of the <code>recyclerView</code> with the height of the toolbar the issue is resolved BUT only for the initial inflation of the layout. After rotation I am left with a gap on the bottom of the screen. I'm using sdk 23.</p>

<p>A possible workaround would be to programmatically remove the padding after the very first inflation of the layout. I assume I could use: </p>

<pre><code>onCreateView(){ if (onSaveInstanceState != null) removePadding();}
</code></pre>

<p>However, I'd rather not have to do a dodgy work-around. </p>

<p>My app is basically exactly the same as the Master/Detail-flow template supplied in Android Studio, except that I use fragments and a single Activity. There is no such issue in the template.</p>

<p>Any ideas?</p>

<p>fragment_item_list.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"&gt;

    &lt;android.support.design.widget.AppBarLayout
        android:id="@+id/app_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay"&gt;

        &lt;android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            app:popupTheme="@style/AppTheme.PopupOverlay" /&gt;

    &lt;/android.support.design.widget.AppBarLayout&gt;

    &lt;FrameLayout
        android:id="@+id/frameLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"&gt;

        &lt;include layout="@layout/item_list" /&gt;
    &lt;/FrameLayout&gt;

    &lt;android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_margin="@dimen/fab_margin"
        android:src="@android:drawable/ic_dialog_email" /&gt;


&lt;/android.support.design.widget.CoordinatorLayout&gt;
</code></pre>

<p>item_list.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/item_list"
    android:name="com.idragonit.scrolltabs.ItemListFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginLeft="16dp"
    android:layout_marginRight="16dp"
    app:layoutManager="LinearLayoutManager"
    tools:context="com.idragonit.scrolltabs.ItemListActivity"
    tools:listitem="@layout/item_list_content" /&gt;
</code></pre>

<p>item_list_content.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"&gt;

    &lt;TextView
        android:id="@+id/id"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/text_margin"
        android:textAppearance="?attr/textAppearanceListItem" /&gt;

    &lt;TextView
        android:id="@+id/content"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/text_margin"
        android:textAppearance="?attr/textAppearanceListItem" /&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p>snippet of ItemListFragment.java</p>

<pre><code>Toolbar toolbar = (Toolbar) root.findViewById(R.id.toolbar);
toolbar.setTitle("List");
</code></pre>