Chcę użyć Bottom-sheet z biblioteki wsparcia i dwóch ruchomych przycisków akcji (FABS), jak pokazuje obrazy. Chodzi o to, że chcę, aby oba FABS poruszały się razem z dolnym arkuszem, tak jak obraz 1 i 2. Jaki jest podstawowy układ, który muszę zastosować i jak sprawić, aby FABS był lepki na dolnej stronie?Arkusz kalkulacyjny z ruchomymi pływającymi przyciskami akcji
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">
<!-- my context here -->
</LinearLayout>
<!-- bottomsheet -->
<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>
<!-- FABS -->
<!-- wrap to primary fab to extend the height -->
<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>
<!-- Pin secondary fab in the top of the extended primary -->
<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>
podstawie Ruan_Lopes odpowiedź.
Przy tym układzie moje FABS działają tak, jak chcę, ale nadal uważam, że nie robię tego bardzo jasno.
Zastanawiam się, czy można to zrobić w bardziej oficjalny sposób.
'myślę, że nie robię tego bardzo jasno. - SO nie jest forum dyskusyjnym - zadałeś pytanie i odpowiedziałeś na @Ruan_Lopes. Zgodnie z twoimi komentarzami, to rozwiązuje twój problem i twoje FAB-y poruszają się zgodnie z twoimi oczekiwaniami, dlatego powinieneś zaakceptować jego odpowiedź i zamknąć to pytanie. Jeśli masz inny problem, powinieneś zadać kolejne pytanie. –
Proszę o przenoszenie fab ze spacją między nimi. Nie mam problemu z odpowiedzią, ale jest dla mnie o połowę. – thanassis