How to hide Only Tablayout when scroll in Fragment's GridView?
<p>I need to hide Tablayout and Filter Layout when scroll in fragment's GridView.
Here I tried to hide only Tablayout by refers this <a href="https://stackoverflow.com/questions/32069521/hiding-showing-the-toolbar-when-fragment-in-the-tabs-is-scrolled">link</a> but its not working. 
How to Hide two layouts when scroll.</p>

<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"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/ll_main_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="false"
    android:orientation="vertical"&gt;

        &lt;android.support.design.widget.CoordinatorLayout
        android:id="@+id/main_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"&gt;

        &lt;android.support.design.widget.AppBarLayout
            android:id="@+id/id_appbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"&gt;

            &lt;android.support.design.widget.CollapsingToolbarLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_scrollFlags="scroll|enterAlways"&gt;

                &lt;android.support.design.widget.TabLayout
                    android:id="@+id/tab_layout_discover"
                    style="@style/AppTabLayout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:elevation="6dp"
                    android:minHeight="?attr/actionBarSize"
                    app:tabTextAppearance="@style/AppTabTextAppearance"
                    app:layout_scrollFlags="scroll|enterAlways"/&gt;
            &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;

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

        &lt;android.support.v4.view.ViewPager
            android:id="@+id/view_pager_discover"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" /&gt;
        &lt;/android.support.design.widget.CoordinatorLayout&gt;
&lt;/RelativeLayout&gt;
</code></pre>

<p>Here shared my example <a href="https://i.stack.imgur.com/C7K3w.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C7K3w.jpg" alt="enter image description here"></a></p>