title: Floating action button anchor
body: <p>I need to anchor floating action button in android, but have the trouble:
  fab will be in navigationview
  Here is my activity_main layout.
  It includes navigation drawer.</p>
  
  <pre><code>&lt;android.support.v4.widget.DrawerLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@color/colorBackground"&gt;
      &lt;!-- The main content view --&gt;
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical"&gt;
  
          &lt;include
              layout="@layout/toolbar_main"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"/&gt;
          &lt;FrameLayout
              android:id="@+id/content_frame"
              android:layout_width="match_parent"
              android:layout_height="match_parent" /&gt;
  
      &lt;/LinearLayout&gt;
      &lt;!-- The navigation drawer --&gt;
      &lt;include
          layout="@layout/nav_drawer"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="start"/&gt;
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>Navigation drawer layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.design.widget.CoordinatorLayout
      android:id="@+id/clDrawer"
      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"
      android:background="@color/colorPrimary"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical"&gt;
  
          &lt;android.support.design.widget.NavigationView
              android:id="@+id/navView"
              android:layout_width="wrap_content"
              android:layout_height="match_parent"
              android:layout_gravity="start"
              app:menu="@menu/menu_drawer_view"
              app:headerLayout="@layout/anav_header"
              android:background="@color/colorPrimary2"
              app:itemIconTint="@color/colorIcon"
              app:itemTextColor="@color/colorIcon"/&gt;
      &lt;/LinearLayout&gt;
  
  
      &lt;android.support.design.widget.FloatingActionButton
          android:id="@+id/navFAB"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_margin="@dimen/activity_horizontal_margin"
          android:clickable="true"
          android:src="@drawable/plus_icon"
          app:backgroundTint="@color/colorIcon"
          app:layout_anchor="@id/headerLayout"
          app:layout_anchorGravity="bottom|right|end" /&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>And my <code>anav_header</code> for navigation view contains only the few text view.
  I need fab to be anchored to the botom of the header, right between header and main content of ND. 
  The problem is <code>layout_anchor</code> works only if header and nav view are in the same layout. if i use navigationview property <code>headerLayout</code> , <code>layout_anchor</code> doesnt work. Also if i use <code>NavigationView.addHeaderView()</code>, it doesnt work too.
  If i include header in navigation view layout by that way</p>
  
  <pre><code>&lt;include
          layout="@layout/anav_header"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"/&gt;
  </code></pre>
  
  <p>it works, BUT header and navigation view move like different parts. And i need them to act like one navigation drawer.
  <a href="http://i.stack.imgur.com/FSS5s.png" rel="nofollow">I need navigation drawer to lookes smth like that.</a></p>