title: collapsing toolbar is showing extra spacing
body: <p>In my layout, I have <code>CollapsingToolbar</code> layout inside <code>AppBarLayout</code> which draws below status bar as intended. My layout xml is as below</p>
  <pre><code>  &lt;android.support.design.widget.AppBarLayout
          android:id=&quot;@+id/app_bar&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:fitsSystemWindows=&quot;true&quot;
          android:theme=&quot;@style/AppTheme.AppBarOverlay&quot;&gt;
  
          &lt;android.support.design.widget.CollapsingToolbarLayout
              android:id=&quot;@+id/toolbar_layout&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:fitsSystemWindows=&quot;true&quot;
              app:contentScrim=&quot;?attr/colorPrimary&quot;
              app:titleEnabled=&quot;false&quot;
              app:layout_scrollFlags=&quot;scroll|exitUntilCollapsed|enterAlways|snap&quot;&gt;
  
              &lt;ImageView
                  android:layout_width=&quot;match_parent&quot;
                  android:layout_height=&quot;match_parent&quot;
                  android:foreground=&quot;@drawable/header_overlay&quot;
                  android:scaleType=&quot;fitXY&quot;
                  android:fitsSystemWindows=&quot;true&quot;
                  android:src=&quot;@drawable/project_list_header&quot;
                  app:layout_collapseMode=&quot;parallax&quot;/&gt;
  
  
              &lt;android.support.v7.widget.Toolbar
                  android:id=&quot;@+id/toolbar&quot;
                  android:layout_width=&quot;match_parent&quot;
                  android:layout_height=&quot;?attr/actionBarSize&quot;
                  app:popupTheme=&quot;@style/AppTheme.PopupOverlay&quot;/&gt;
  
              &lt;TextView
                  android:id=&quot;@+id/text_search&quot;
                  android:layout_width=&quot;match_parent&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:layout_marginBottom=&quot;?attr/actionBarSize&quot;
                  android:layout_marginTop=&quot;?attr/actionBarSize&quot;
                  android:layout_marginLeft=&quot;@dimen/spacing_16&quot;
                  android:layout_marginRight=&quot;@dimen/spacing_16&quot;
                  android:background=&quot;@drawable/search_background&quot;
                  android:drawableLeft=&quot;@drawable/ic_search_black&quot;
                  android:drawablePadding=&quot;@dimen/spacing_12&quot;
                  android:gravity=&quot;center_vertical&quot;
                  android:layout_gravity=&quot;bottom&quot;
                  android:hint=&quot;@string/search_project_hint&quot;
                  android:paddingBottom=&quot;@dimen/spacing_14&quot;
                  android:paddingLeft=&quot;@dimen/spacing_14&quot;
                  android:paddingRight=&quot;@dimen/spacing_14&quot;
                  android:paddingTop=&quot;@dimen/spacing_14&quot;
                  android:textColorHint=&quot;@color/black_70&quot;
                  android:textSize=&quot;@dimen/text_14&quot;
                  tools:hint=&quot;@string/search_project_hint&quot;&gt;
              &lt;/TextView&gt;
              &lt;android.support.design.widget.TabLayout
                  android:id=&quot;@+id/tab_layout&quot;
                  android:layout_width=&quot;match_parent&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:layout_gravity=&quot;bottom&quot;
                  app:layout_collapseMode=&quot;pin&quot;
                  app:tabGravity=&quot;fill&quot;
                  app:tabMode=&quot;fixed&quot;/&gt;
  
          &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
  
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  </code></pre>
  <p>This gives the below screen</p>
  <p><a href="https://i.stack.imgur.com/a17MC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a17MC.png" alt="Normal image" /></a></p>
  <p>But when i scroll down it gives extra black spacing in the top and in bottom of <code>AppBarLayout</code></p>
  <p><a href="https://i.stack.imgur.com/jCgUS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jCgUS.png" alt="Extra spacing" /></a></p>
  <p>And if i remove <code>enterAlways</code> flag from <code>app:layout_scrollFlags</code>, then the extra spacing is gone but <code>AppBar</code> does not show when I scroll up.</p>
  <p>So how to remove that spacing and show <code>AppBar</code> when scrolling up?</p>