How to make Layout above RecyclerView Scroll away
<p>This is my layout:</p>

<pre><code>&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"
                xmlns:app="http://schemas.android.com/apk/res-auto"
                android:id="@+id/book_root_layout"&gt;
    &lt;LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:id="@+id/book_spinner_root"&gt;

        &lt;RelativeLayout
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="wrap_content"&gt;

            &lt;Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/book_cat_show"
                android:text="@string/show_categories"
                android:layout_alignParentLeft="true"
                android:layout_gravity="left"
                android:ellipsize="end"
                android:maxLines="1"
                android:layout_marginLeft="5dp"
                android:textSize="12sp"
                android:stateListAnimator="@null"
                android:background="@drawable/tagcat_button"
                android:minHeight="0dp"
                android:minWidth="0dp"
                android:padding="7dp"
                android:layout_centerInParent="true"
                android:textColor="@color/white"
                android:textStyle="bold"
                android:layout_marginTop="10dp"
                android:visibility="visible"/&gt;

            &lt;ProgressBar
                android:layout_width="30dp"
                android:layout_height="30dp"
                android:layout_centerInParent="true"
                android:indeterminateTint="@color/colorAccent"
                android:visibility="visible"
                android:id="@+id/book_cat_prog"/&gt;

            &lt;Spinner
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="5dp"
                android:visibility="visible"
                android:id="@+id/book_cat_spinner"
                style="@android:style/Widget.Holo.Light.Spinner"/&gt;
        &lt;/RelativeLayout&gt;

        &lt;RelativeLayout
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="wrap_content"&gt;

            &lt;Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/book_tag_show"
                android:text="@string/show_tags"
                android:layout_alignParentRight="true"
                android:layout_marginRight="5dp"
                android:stateListAnimator="@null"
                android:maxLines="1"
                android:ellipsize="end"
                android:textSize="12sp"
                android:background="@drawable/tagcat_button"
                android:minHeight="0dp"
                android:minWidth="0dp"
                android:padding="7dp"
                android:layout_centerInParent="true"
                android:textColor="@color/white"
                android:textStyle="bold"
                android:layout_marginTop="10dp"
                android:visibility="visible"/&gt;

            &lt;ProgressBar
                android:layout_width="30dp"
                android:layout_height="30dp"
                android:visibility="visible"
                android:layout_centerInParent="true"
                android:indeterminateTint="@color/colorAccent"
                android:id="@+id/book_tag_prog"/&gt;

            &lt;Spinner
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:visibility="visible"
                android:layout_margin="5dp"
                android:id="@+id/book_tag_spinner"
                style="@android:style/Widget.Holo.Light.Spinner"/&gt;
        &lt;/RelativeLayout&gt;
    &lt;/LinearLayout&gt;

    &lt;android.support.v4.widget.SwipeRefreshLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/book_spinner_root"
        android:id="@+id/swipe_refrsh"&gt;

        &lt;android.support.v7.widget.RecyclerView
            android:id="@+id/book_recycler"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior"
            android:scrollbars="vertical"
            android:scrollbarFadeDuration="500"/&gt;
    &lt;/android.support.v4.widget.SwipeRefreshLayout&gt;
    &lt;include layout="@layout/loading"/&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p>What happens is that as I scroll the recyclerview, the LinearLayout (book_spinner_root) above the <code>SwipeRefreshLayout</code> remains fixed to the top of the screen. But what I really wanted is the LinearLayout to scroll away as I am scrolling.</p>

<p>Please how do I achieve this?</p>