title: GridView under Toolbar - Hide ToolBar when Scrolling
body: <p>I have the following layout for my Activity:</p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
          &lt;FrameLayout
              android:id="@+id/content_fragment"
              android:layout_width="match_parent"
              android:layout_height="match_parent" /&gt;
  
      &lt;include layout="@layout/toolbar" /&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>content_fragment is the place where I replace a fragment which includes a gridView:</p>
  
  <pre><code>&lt;android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/swipe_refresh_layout"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      tools:context="com.test.android.client.fragment.BurgerGridFragment"&gt;
  
          &lt;GridView
              android:id="@+id/grid"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:clipToPadding="false"
              android:columnWidth="150dp"
              android:horizontalSpacing="@dimen/margin_extra_small"
              android:numColumns="auto_fit"
              android:padding="@dimen/padding_extra_small"
              android:scrollbars="none"
              android:stretchMode="columnWidth"
              android:verticalSpacing="@dimen/margin_extra_small" /&gt;
  
      &lt;/android.support.v4.widget.SwipeRefreshLayout&gt;
  </code></pre>
  
  <p>My idea is as soon I scroll in GridView, Toolbar should appears/disappears with animation:</p>
  
  <pre><code>if (shown) {
  
  
  view.animate()
                      .translationY(0)
                      .alpha(1)
                      .setDuration(HEADER_HIDE_ANIM_DURATION)
                      .setInterpolator(new DecelerateInterpolator());
          } else {
              view.animate()
                      .translationY(-view.getBottom())
                      .alpha(0)
                      .setDuration(HEADER_HIDE_ANIM_DURATION)
                      .setInterpolator(new DecelerateInterpolator());
          }
  </code></pre>
  
  <p>The problem is first grid items have partially overlapped by toolBar.
  Do you know how to solve the problem?</p>
  
  <p>Addenda:</p>
  
  <p>I have tried RelativeLayout as well as LinearLayout instead of FrameLayout for my Activity, but that will not be a solution and I get into another problem as described <a href="https://stackoverflow.com/questions/29163698/hiding-toolbar-when-scrolling-layout-under-toolbar-does-not-disapear">https://stackoverflow.com/questions/29163698/hiding-toolbar-when-scrolling-layout-under-toolbar-does-not-disapear</a></p>