I want to use the bottom sheet from the support library and two buttons with a floating action (FABS), as shown in the figures. The fact is that I also want both FABS to move along with the bottom sheet, as in Figures 1 and 2. What basic scheme should I use and how to make FABS sticky on the bottom sheet?

UPDATE
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" android:orientation="vertical" tools:context=".MainActivity"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay"/> </android.support.design.widget.AppBarLayout> <android.support.design.widget.CoordinatorLayout android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"> </LinearLayout> <FrameLayout android:id="@+id/bottom_sheet" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ff0000" app:behavior_hideable="true" app:layout_behavior="android.support.design.widget.BottomSheetBehavior"> <include layout="@layout/navigation_info" /> </FrameLayout> <LinearLayout android:id="@+id/primary_wrap" android:layout_width="wrap_content" android:layout_height="88dp" app:layout_anchor="@id/bottom_sheet" app:layout_anchorGravity="top|end"> <android.support.design.widget.FloatingActionButton android:id="@+id/primary" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="@dimen/fab_margin" android:src="@android:drawable/ic_delete"/> </LinearLayout> <android.support.design.widget.FloatingActionButton android:id="@+id/secondary" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="top|end" android:layout_margin="16dp" android:src="@android:drawable/ic_dialog_email" app:layout_anchor="@+id/primary_wrap" app:layout_anchorGravity="top|end"/> </android.support.design.widget.CoordinatorLayout>
Based on the answer of Ruan_Lopes .
With this layout, my FABS works as I want, but I still think that I am not doing this very clearly.
I wonder if this can be done in a more formal way.
android android-layout floating-action-button bottom-sheet
thanassis
source share