how to put the float in the start of bottomAppBar

Viewed 48

is there any way to put the float in the start i found that the app:fabAlignmentMode have only 2 option (center , end )

 <attr name="fabAlignmentMode">
  <!-- Mode that aligns the fab to the center. -->
  <enum name="center" value="0"/>
  <!-- Mode that aligns the fab to the end. -->
  <enum name="end" value="1"/>
</attr>

is there is a way to put it on the start

1 Answers

Temporarily I don't find good solution for this, so u can try a workaround like mine:

enter image description here

 <androidx.coordinatorlayout.widget.CoordinatorLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

       <FrameLayout
            android:id="@+id/attachment_layout"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_gravity="bottom" />

       <LinearLayout
            android:id="@+id/bottom_bar"
            android:layout_width="match_parent"
            android:layout_height="@dimen/_40sdp"
            android:orientation="horizontal"
            app:layout_anchor="@+id/attachment_layout">

            <!-- put some button menu here-->
       </LinearLayout>

       <com.google.android.material.floatingactionbutton.FloatingActionButton
            android:id="@+id/fab"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:fabCustomSize="@dimen/_50sdp"
            android:layout_marginBottom="@dimen/_15sdp"
            android:layout_marginStart="@dimen/_20sdp"
            app:layout_anchor="@id/bottom_bar" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>
Related