title: Two floating button in the one layout
body: <p>I am creating a simple app using material design. I want to get two floating buttons inside one layout.</p>
  <p><img src="https://i.stack.imgur.com/anx3V.png" alt="Material design documents example" /></p>
  <p>And I want to make them move together when a snack bar is being displayed.</p>
  <p>But I can't do this correctly because the <code>layout_margin</code> doesn't work.</p>
  <p>These are the screenshots of the app and the markup. Can you help me?</p>
  <p><img src="https://i.stack.imgur.com/7fNAo.png" alt="Before showing a snackbar" />
  <img src="https://i.stack.imgur.com/E3025.png" alt="After showing a snackbar" /></p>
  <pre class="lang-xml prettyprint-override"><code>&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;
    android:id=&quot;@+id/addProductsContainer&quot;
    android:layout_width=&quot;match_parent&quot;
    android:layout_height=&quot;match_parent&quot;
    android:fitsSystemWindows=&quot;true&quot;&gt;
  
    &lt;android.support.design.widget.AppBarLayout
      android:id=&quot;@+id/addProductsAppBar&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;wrap_content&quot;
      android:theme=&quot;@style/ThemeOverlay.AppCompat.Dark.ActionBar&quot;&gt;
  
      &lt;android.support.design.widget.TabLayout
        android:id=&quot;@+id/addProductsTabs&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot; /&gt;
  
    &lt;/android.support.design.widget.AppBarLayout&gt;
  
    &lt;android.support.v4.view.ViewPager
      android:id=&quot;@+id/addProductsViewpager&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      app:layout_behavior=&quot;@string/appbar_scrolling_view_behavior&quot; /&gt;
  
    &lt;android.support.design.widget.FloatingActionButton
      android:id=&quot;@+id/addProductFab&quot;
      android:layout_width=&quot;wrap_content&quot;
      android:layout_height=&quot;wrap_content&quot;
      android:layout_gravity=&quot;end|bottom&quot;
      android:layout_margin=&quot;16dp&quot;
      android:src=&quot;@drawable/ic_add_white_36dp&quot; /&gt;
  
    &lt;android.support.design.widget.FloatingActionButton
      android:id=&quot;@+id/searchFab&quot;
      android:layout_width=&quot;wrap_content&quot;
      android:layout_height=&quot;wrap_content&quot;
      app:layout_anchor=&quot;@id/addProductFab&quot;
      app:layout_anchorGravity=&quot;top|right|end&quot;
      android:layout_marginBottom=&quot;80dp&quot;
      android:layout_marginRight=&quot;16dp&quot;
      android:src=&quot;@drawable/ic_search_white_36dp&quot; /&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt; 
  </code></pre>