title: FloatingActionButton is cut off when scrolling Toolbar
body: <p>When Scrolling the RecyclerView, the Toolbar and the TabLayout are both collapsed as supposed, but the FloatingActionButton cut off</p>
  
  <p>I followed these instructions:
  <a href="https://stackoverflow.com/questions/34954730/hide-floating-button-when-collapsing-toolbar-is-collapsed">Hide floating button when collapsing toolbar is collapsed</a>
  that suggest to add the attributes</p>
  
  <pre><code>&lt;android.support.design.widget.FloatingActionButton
  ...
  app:layout_anchor="@id/appBar"
  app:layout_anchorGravity="bottom|right|end" /&gt;
  </code></pre>
  
  <p>but my AppBarLayout is living inside another layout (xml) file => app_bar_main.xml</p>
  
  <p>app_bar_main.xml :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&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:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context="com.eawedat.tabasam.MainActivity"&gt;
  
  &lt;android.support.design.widget.AppBarLayout
      android:id="@+id/appBar"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:theme="@style/AppTheme.AppBarOverlay"&gt;
  
      &lt;android.support.v7.widget.Toolbar
          android:id="@+id/toolbar"
          android:layout_width="match_parent"
          android:layout_height="?attr/actionBarSize"
          android:background="?attr/colorPrimary"
          app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
          app:popupTheme="@style/AppTheme.PopupOverlay" /&gt;
  &lt;/android.support.design.widget.AppBarLayout&gt;
  
  &lt;include layout="@layout/content_main" /&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>images.xml :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout 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"
  xmlns:tools="http://schemas.android.com/tools"
  android:orientation="vertical"&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"
      android:id="@+id/main_content"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
  
          &lt;android.support.v7.widget.RecyclerView
              android:id="@+id/imagesgallery"
              android:layout_width="match_parent"
              android:layout_height="wrap_content" /&gt;
  
  
  
  
          &lt;android.support.design.widget.FloatingActionButton
              android:id="@+id/fabImage"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="bottom|right|end"
              android:layout_margin="16dp"
              android:src="@drawable/ic_image_white_24dp"
              app:backgroundTint="@color/colorPrimary" /&gt;
  
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>Images.java :</p>
  
  <pre><code>    recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
  @Override
  public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int     dy) {
  super.onScrolled(recyclerView, dx, dy);
  if (dy &gt; 0 &amp;&amp; fab.getVisibility() == View.VISIBLE) {
  fab.hide();
  } else if (dy &lt; 0 &amp;&amp; fab.getVisibility() != View.VISIBLE) {
  fab.show();
  }
  }
  });
  </code></pre>
  
  <p>I expect either to fully show the FloatingActionButton or to fully hide it.</p>
  
  <p><a href="https://i.stack.imgur.com/ychaC.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ychaC.jpg" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/z3XPu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/z3XPu.jpg" alt="enter image description here"></a></p>