title: Android: CoordinatorLayout and SwipeRefreshLayout
body: <p>I try to implement auto hiding toolbar feature from the new support library 22.2.0. Without SwipeRefreshLayout is working fine:</p>
  
  <p><img src="https://i.stack.imgur.com/k3v0Q.png" alt="enter image description here"></p>
  
  <p>But when I re add this layout, toolbar <strong>overlap</strong> the recyclerview:</p>
  
  <p><img src="https://i.stack.imgur.com/UZNkb.png" alt="enter image description here"></p>
  
  <p><strong>Code:</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;android.support.v4.widget.DrawerLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"&gt;
  
      &lt;android.support.design.widget.CoordinatorLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          xmlns:fab="http://schemas.android.com/apk/res-auto"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;android.support.design.widget.AppBarLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"&gt;
  
              &lt;android.support.v7.widget.Toolbar
                  xmlns:android="http://schemas.android.com/apk/res/android"
                  xmlns:app="http://schemas.android.com/apk/res-auto"
                  android:id="@+id/toolbar"
                  android:layout_width="match_parent"
                  android:layout_height="?attr/actionBarSize"
                  android:background="?attr/colorPrimary"
                  android:theme="@style/ThemeOverlay.ActionBar"
                  app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
                  app:layout_scrollFlags="scroll|enterAlways"/&gt;
  
          &lt;/android.support.design.widget.AppBarLayout&gt;
  
          &lt;android.support.v4.widget.SwipeRefreshLayout
              xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/swipe_container"
              android:layout_width="match_parent"
              android:layout_height="match_parent"&gt;
  
              &lt;android.support.v7.widget.RecyclerView
                  android:id="@+id/cardList"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:scrollbars="vertical"
                  app:layout_behavior="@string/appbar_scrolling_view_behavior"/&gt;
  
          &lt;/android.support.v4.widget.SwipeRefreshLayout&gt;
      &lt;/android.support.design.widget.CoordinatorLayout&gt;
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p><strong>UPDATE 2020 with Androidx:</strong> </p>
  
  <p><strong>Code:</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>    &lt;androidx.drawerlayout.widget.DrawerLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"&gt;
  
      &lt;androidx.coordinatorlayout.widget.CoordinatorLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          xmlns:fab="http://schemas.android.com/apk/res-auto"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;com.google.android.material.appbar.AppBarLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"&gt;
  
              &lt;androidx.appcompat.widget.Toolbar
                  xmlns:android="http://schemas.android.com/apk/res/android"
                  xmlns:app="http://schemas.android.com/apk/res-auto"
                  android:id="@+id/toolbar"
                  android:layout_width="match_parent"
                  android:layout_height="?attr/actionBarSize"
                  android:background="?attr/colorPrimary"
                  android:theme="@style/ThemeOverlay.ActionBar"
                  app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
                  app:layout_scrollFlags="scroll|enterAlways"/&gt;
  
          &lt;/com.google.android.material.appbar.AppBarLayout&gt;
  
          &lt;androidx.swiperefreshlayout.widget.SwipeRefreshLayout
              xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/swipe_container"
              android:layout_width="match_parent"
              android:layout_height="match_parent"&gt;
  
              &lt;androidx.recyclerview.widget.RecyclerView
                  android:id="@+id/cardList"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:scrollbars="vertical"
                  app:layout_behavior="@string/appbar_scrolling_view_behavior"/&gt;
  
          &lt;/androidx.swiperefreshlayout.widget.SwipeRefreshLayout&gt;
      &lt;/androidx.coordinatorlayout.widget.CoordinatorLayout&gt;
  &lt;/androidx.drawerlayout.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>Any idea how to fix this?</p>