title: How to prevent FAB from scrolling with CoordinateLayout in Android
body: <p>I've the below layout xml for my activity</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:tools="http://schemas.android.com/tools"
       android:layout_width="match_parent"
       android:layout_height="match_parent"
       android:background="@color/white"
       android:fitsSystemWindows="true"
       tools:context=".HomeActivity"&gt;
  
       &lt;android.support.design.widget.AppBarLayout
            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="wrap_content"
            android:theme="@style/AppTheme.Dark.AppBarOverlay"
            app:elevation="0dp"&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|enterAlways"
                 app:popupTheme="@style/AppTheme.Dark.PopupOverlay"&gt;
       &lt;/android.support.design.widget.AppBarLayout&gt;
  
       &lt;RelativeLayout
          android:id="@+id/rl_updates"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_above="@+id/ll_footer"
          android:layout_below="@+id/ll_fibres_search"&gt;
  
          &lt;android.support.v4.widget.SwipeRefreshLayout
                android:id="@+id/srl_updates"
                android:layout_width="match_parent"
                android:layout_height="match_parent"&gt;
  
                 &lt;android.support.v7.widget.RecyclerView
                       android:id="@+id/rv_all_requirements"
                       android:layout_width="match_parent"
                       android:layout_height="match_parent"
                       android:divider="@color/iron"
                       android:dividerHeight="1px"/&gt;
           &lt;/android.support.v4.widget.SwipeRefreshLayout&gt;
  
           &lt;android.support.design.widget.FloatingActionButton
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_marginBottom="@dimen/activity_horizontal_margin"
                android:layout_marginEnd="@dimen/activity_horizontal_margin"
                android:layout_marginRight="@dimen/activity_horizontal_margin"
                android:onClick="onRequirement"
                android:overScrollMode="never"
                android:src="@drawable/ic_playlist_add_white_24dp"
                app:backgroundTint="@color/pink"/&gt;
      &lt;/RelativeLayout&gt;
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>When I scroll the Recycler View, the App Bar collapses just like I wanted it to be. But the problem is the FAB also shifts down a little bit. I set 16dp margin to the bottom but it sticks to the bottom of the screen.</p>
  
  <p>How do I prevent the FAB from shifting down initially?</p>
  
  <p>This is how it looks now
  <a href="https://i.stack.imgur.com/GJtnT.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/GJtnT.jpg" alt="enter image description here"></a></p>