title: implementing a custom behavior on recyclerview inside coordinatorlayout
body: <p>I have 3 views in my layout file with CoordinatorLayout as the root view : AppbarLayout, RecyclerView and a Footer(not visible all the time). Recyclerview implements the default behavior appbar_scrolling_view_behavior, that ideally, brings recyclerview below the appbarlayout. But the recyclerview and footer overlap. To Prevent that, I had to write a custom behavior so that when footer is visible, Recyclerview should make space for the footer. But now, the default behavior of appbar_scrolling_view_behavior is gone and now appbarlayout and recyclerview overlap.<a href="http://i.stack.imgur.com/io2YX.jpg" rel="nofollow">Here is the Image of the layout</a> </p>
  
  <p>Link to the custom behavior i implemented:
  <a href="https://github.com/Mandeep221/CustomBehaviorForRecyclerview/blob/master/CustomBehavior.java" rel="nofollow">https://github.com/Mandeep221/CustomBehaviorForRecyclerview/blob/master/CustomBehavior.java</a></p>
  
  <p>My Question: How can i implement 2 things(simultaneously in one behavior):</p>
  
  <ol>
  <li>get the recyclerview below the appbarlayout inside the co-ordinatorlayout</li>
  <li>get the recycelerview to make space for the footer if the footer is visible.</li>
  </ol>
  
  <p>If you can suggest some workaround, that would also be great! Thanks alot!</p>
  
  <p>
  </p>
  
  <pre><code>&lt;android.support.design.widget.AppBarLayout
      android:id="@+id/appBarLayout"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"&gt;
  
      &lt;android.support.v7.widget.Toolbar
          android:id="@+id/app_bar"
          android:layout_width="match_parent"
          android:layout_height="?attr/actionBarSize"
          android:background="?attr/colorPrimary"
          app:layout_scrollFlags="scroll|enterAlways|snap" /&gt;
  
  &lt;/android.support.design.widget.AppBarLayout&gt;
  
  &lt;android.support.v7.widget.RecyclerView 
  xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          android:id="@+id/list_recycler_view"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_marginTop="4dp"
          android:scrollbars="vertical"
        app:layout_behavior="prokure.it.prokure.Search.NewSearch.CustomBehavior" /&gt;
  
  
      &lt;prokure.it.prokure.FooterBarLayout
          android:id="@+id/footerBar"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="bottom"&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"&gt;
  
          //footer child views    
  
              &lt;/LinearLayout&gt;
      &lt;/prokure.it.prokure.FooterBarLayout&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>