title: floating action button (fab) scrolling action not working
body: <p>i am trying to make the "fab" disappear when scrolling up and appear when scrolling down but nothing happens </p>
  
  <p>this layout is included in other DrawerLayout</p>
  
  <pre><code>     &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:fresco="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/coord_layout"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:fitsSystemWindows="true"
  android:layoutDirection="rtl"
  tools:context="co.broccli.n5rogfeen.ProfileActivity"&gt;
  &lt;!--#android:fitsSystemWindows="true"
  tools:openDrawer="start"&gt;--&gt;
  &lt;include layout="@layout/content_scrolling" /&gt;
  
  &lt;View
      android:layout_width="match_parent"
      android:layout_height="30dp"
  
      android:background="@drawable/toolbar_dropshadow"
      app:layout_anchor="@id/appbar"
      app:layout_anchorGravity="bottom" /&gt;
  &lt;android.support.design.widget.AppBarLayout
      android:id="@+id/appbar"
      android:layout_width="match_parent"
      android:layout_height="190dp"
      android:theme="@style/AppTheme.AppBarOverlay"
      tools:layout_editor_absoluteY="-2dp"
  
      &gt;
  
      &lt;android.support.design.widget.CollapsingToolbarLayout
          android:id="@+id/toolbar_layout"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:fitsSystemWindows="true"
          app:contentScrim="?attr/colorPrimary"
          app:layout_scrollFlags="scroll|exitUntilCollapsed"
          app:toolbarId="@+id/toolbar"&gt;
  
  
          &lt;android.support.v7.widget.LinearLayoutCompat
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="bottom|center_horizontal"
              android:orientation="vertical"
              android:paddingBottom="10dp"
              app:layout_collapseMode="parallax"&gt;
  
              &lt;com.facebook.drawee.view.SimpleDraweeView
                  android:id="@+id/my_image_view"
                  android:layout_width="75dp"
                  android:layout_height="75dp"
                  android:layout_gravity="center_vertical|center_horizontal"
                  fresco:placeholderImage="@color/colorAccent"
                  fresco:roundAsCircle="true"
                  fresco:viewAspectRatio="1.33"
                  /&gt;
  
              &lt;android.support.v7.widget.AppCompatTextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_gravity="center_horizontal"
                  android:text="name" /&gt;
  
  
              &lt;android.support.v7.widget.AppCompatTextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_gravity="center_horizontal"
                  android:text="@string/acc_balance" /&gt;
          &lt;/android.support.v7.widget.LinearLayoutCompat&gt;
  
  
          &lt;android.support.v7.widget.Toolbar
              android:id="@+id/toolbar"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize"
              android:layout_gravity="top"
              app:layout_collapseMode="pin"
              app:popupTheme="@style/AppTheme.PopupOverlay"&gt;
  
              &lt;TextView
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:gravity="center"
                  android:text="@string/app_name"
                  android:textAppearance="@style/Base.TextAppearance.AppCompat.Large" /&gt;
          &lt;/android.support.v7.widget.Toolbar&gt;
  
  
      &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
  
  
  &lt;/android.support.design.widget.AppBarLayout&gt;
  
  
  &lt;android.support.design.widget.FloatingActionButton
      android:id="@+id/floating_action_button"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="bottom|end"
      android:layout_margin="16dp"
      android:src="@drawable/ic_mode_edit_black_24px"
      android:background="@color/colorPrimary"
      app:backgroundTint="@color/colorPrimary"
      app:fabSize="normal"
  
     /&gt;
  </code></pre>
  
  <p></p>
  
  <p>the recyclerview is in the included layout "content_scrolling"  </p>
  
  <pre><code>     final FloatingActionButton mFloatingActionButton = (FloatingActionButton) findViewById(R.id.floating_action_button);
      mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
          @Override
          public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
              super.onScrolled(recyclerView, dx, dy);
              if (dy &gt; 0 &amp;&amp; mFloatingActionButton.getVisibility() == View.VISIBLE) {
                  mFloatingActionButton.hide();
              } else if (dy &lt; 0 &amp;&amp; mFloatingActionButton.getVisibility() != View.VISIBLE) {
                  mFloatingActionButton.show();
              }
          }
      });
  </code></pre>
  
  <p>i although tried to use floating action button behavior but worked only when i scroll to the end and  when the fab disappears it doesn't appear again  </p>
  
  <pre><code>   public class ScrollAwareFABBehavior extends FloatingActionButton.Behavior { private static final String TAG = "ScrollAwareFABBehavior";
  
  public ScrollAwareFABBehavior(Context context, AttributeSet attrs) {
      super();
  }
  
  public boolean onStartNestedScroll(CoordinatorLayout parent, FloatingActionButton child, View directTargetChild, View target, int nestedScrollAxes) {
      return true;
  }
  
  @Override
  public boolean layoutDependsOn(CoordinatorLayout parent, FloatingActionButton child, View dependency) {
      if(dependency instanceof RecyclerView)
          return true;
  
      return false;
  }
  
  @Override
  public void onNestedScroll(CoordinatorLayout coordinatorLayout,
                             FloatingActionButton child, View target, int dxConsumed,
                             int dyConsumed, int dxUnconsumed, int dyUnconsumed) {
      // TODO Auto-generated method stub
      super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed,
              dxUnconsumed, dyUnconsumed);
  
      if (dyConsumed &gt; 0 &amp;&amp; child.getVisibility() == View.VISIBLE) {
          child.hide();
      } else if (dyConsumed &lt; 0 &amp;&amp; child.getVisibility() != View.VISIBLE) {
          child.show();
      }
  }
  } 
  </code></pre>