title: Android FAB custom behavior loses default SnackBar adjustment behavior
body: <p>I have a FAB (Floating Action Button)</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"
  android:id="@+id/coordinatorLayout"
  android:layout_width="match_parent"
  android:layout_height="match_parent"&gt;
  
  ...
  
  &lt;android.support.design.widget.FloatingActionButton
      android:id="@+id/fabButton"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="bottom|right"
      android:layout_margin="@dimen/fab_margin"
      app:layout_anchorGravity="bottom|right|end"
      android:src="@drawable/img"
      app:borderWidth="0dp"
      /&gt;
  </code></pre>
  
  <p></p>
  
  <p>This FAB exists on top of a RecycleView that I scroll through. At certain stage of scrolling I show SnackBar and everything works as advertised (specifically, the SnackBar shifts the FAB to avoid blockage.</p>
  
  <p>Now I want to implement a custom behavior, the one that on scroll down I want to hide FAB.</p>
  
  <p>So I have created a custom behavior:</p>
  
  <pre><code>public class CustomBehavior extends CoordinatorLayout.Behavior&lt;FloatingActionButton&gt; {
  private int toolbarHeight;
  
  public CustomBehavior(Context context, AttributeSet attrs) {
      super(context, attrs);
      this.toolbarHeight = Utils.getToolbarHeight(context);
  }
  
  @Override
  public boolean layoutDependsOn(CoordinatorLayout parent, FloatingActionButton fab, View dependency) {
      return dependency instanceof AppBarLayout;
  }
  
  @Override
  public boolean onDependentViewChanged(CoordinatorLayout parent, FloatingActionButton fab, View dependency) {
      if (dependency instanceof AppBarLayout) {
          CoordinatorLayout.LayoutParams lp = (CoordinatorLayout.LayoutParams) fab.getLayoutParams();
          int fabBottomMargin = lp.bottomMargin;
          int distanceToScroll = fab.getHeight() + fabBottomMargin;
          float ratio = (float)dependency.getY()/(float)toolbarHeight;
          fab.setTranslationY(-distanceToScroll * ratio);
      }
      return true;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>This pretty much hides my FAB when I scroll down (it hides together with AppBarLayout
  So I add this to my FAB xml declaration</p>
  
  <pre><code> app:layout_behavior="com.example.CustomBehavior"
  </code></pre>
  
  <p>When I do this, the FAB properly hides, but the SnackBar overlaps it when it shows. Meaning the default behavior is gone...</p>
  
  <p>Is it possible to have both?</p>