title: How to anchor a Floating Action Button to the App ToolBar like in the guide images?
body: <p>I want to get a Floating Action Button anchored to the upper part of my activity, on the action bar. In the guides is not explained how to get that effect of getting the floating action button anchored to the action bar and also getting the action bar moved with a smooth automatic effect when the user moves the screen.</p>
  <p>That is what I want to achieve but I can't find the explanation. I'm using this layout, and by default It's positioned on the lower right part of the screen.</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;android.support.design.widget.CoordinatorLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      tools:context=&quot;com.Activity&quot;&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:theme=&quot;@style/AppTheme.AppBarOverlay&quot;&gt;
  
          &lt;android.support.v7.widget.Toolbar
              android:id=&quot;@+id/toolbar&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;?attr/actionBarSize&quot;
              android:background=&quot;?attr/colorPrimary&quot;
              app:popupTheme=&quot;@style/AppTheme.PopupOverlay&quot; /&gt;
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;include layout=&quot;@layout/content_favorites&quot; /&gt;
  
      &lt;android.support.design.widget.FloatingActionButton
          android:id=&quot;@+id/fab&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_gravity=&quot;bottom|end&quot;
          android:layout_margin=&quot;@dimen/fab_margin&quot;
          app:srcCompat=&quot;@drawable/ic_add_white_48dp&quot; /&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  <p>Here you can see very cute samples of Floating Action Buttons anchored to the upper action bars in some screenshots:</p>
  <p><a href="https://material.io/guidelines/components/buttons-floating-action-button.html#buttons-floating-action-button-floating-action-button" rel="nofollow noreferrer">https://material.io/guidelines/components/buttons-floating-action-button.html#buttons-floating-action-button-floating-action-button</a></p>
  <p>For example this:</p>
  <p><a href="https://i.stack.imgur.com/mLX8L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mLX8L.png" alt="enter image description here" /></a></p>
  <p>Which changes are necessary to get that positioning and behaviour? Is there a sample or guide of how to achieve this?</p>