title: How to pin "Floating Action Button" correcly using CoordinatorLayout?
body: <p>I use <code>CoordinatorLayout</code> as my root view. It contains a <code>RelativeLayout</code> and a <code>FloatingActionButton</code>. When I set <code>layout_anchor</code> and <code>layout_anchorGravity</code> for the <code>FloatingActionButton</code>, it's not centered on the edge of the <code>RelativeLayout</code> (orange area on the screen) as I expected.</p>
  
  <p>I tried solution from this question <a href="https://stackoverflow.com/questions/24459352/how-can-i-add-the-new-floating-action-button-between-two-widgets-layouts">How can I add the new &quot;Floating Action Button&quot; between two widgets/layouts</a> but without success.</p>
  
  <p><strong>Here is my layout:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &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:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;RelativeLayout
          android:id="@+id/primary_area"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:background="@color/primary"
          android:paddingBottom="30dp"&gt;
  
          &lt;com.vocabularyminer.android.android.view.view.FloatingEditText
              android:id="@+id/edittext_package_name"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="32dp"
              android:layout_marginLeft="14dp"
              android:layout_marginRight="14dp"
              android:layout_marginTop="16dp"
              android:hint="Test fab button"/&gt;
  
      &lt;/RelativeLayout&gt;
  
      &lt;android.support.design.widget.FloatingActionButton
          android:id="@+id/fab"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_margin="16dp"
          android:src="@drawable/ic_done_white_24dp"
          app:elevation="4dp"
          app:layout_anchor="@id/primary_area"
          app:layout_anchorGravity="bottom|right|end"/&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p><strong>Result screen:</strong>
  <a href="https://i.stack.imgur.com/8yVQU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8yVQU.png" alt="Result screen according to the layout file above"></a></p>
  
  <p><strong>What I have expected:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/fT6Zw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fT6Zw.png" alt="enter image description here"></a></p>