if RecyclerView cant cover a full screen, the CoordinatorLayout will not work?
<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/fragment.background"&gt;

    &lt;android.support.design.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"&gt;

        &lt;android.support.design.widget.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/fragment.background"
            android:orientation="vertical"&gt;

            &lt;LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/fragment.background"
                android:orientation="vertical"
                app:layout_scrollFlags="scroll|enterAlways"&gt;

                &lt;TextView
                    style="@style/merchantHintText"
                    android:id="@+id/contract_template_title"
                    android:layout_width="match_parent"
                    android:background="@color/white"
                    android:padding="15dp"/&gt;

                &lt;ImageView
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:src="@color/fragment.background" /&gt;

                &lt;com.tqmall.salestool.merchant.task.UploadImgLayout
                    android:id="@+id/contract_template_imglayout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="10dp"
                    android:background="@color/white"
                    android:orientation="vertical"
                    android:padding="15dp" /&gt;

                &lt;TextView
                    android:id="@+id/contract_template_info"
                    style="@style/merchantHintText"
                    android:layout_width="match_parent"
                    android:background="@color/white"
                    android:padding="15dp"/&gt;

                &lt;ImageView
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:src="@color/fragment.background" /&gt;
            &lt;/LinearLayout&gt;

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

        &lt;com.tqmall.salestool.view.ListRecyclerView
            android:id="@+id/contract_template_list"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            android:paddingBottom="40dp"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" /&gt;

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

    &lt;TextView
        android:id="@+id/contract_template_sure_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:background="@color/text.red"
        android:gravity="center"
        android:padding="10dp"
        android:textColor="@color/white"
        android:textSize="20sp" /&gt;
&lt;/RelativeLayout&gt;
</code></pre>

<p>When my adapter have enough number of data (which inflating a much higher view than screen), the LinearLayout in AppBarLayout will collapse correctly. However, if there are few data, it will not collapse. I read the source code of AppBarLayout, but not find the code cause that.</p>

<p>Why it acts like that?</p>