I am currently using the combination of BottomAppBar And FloatingActionButton in my Layout (obviously inside CoordinatorLayout): see layout:
<com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:backgroundTint="@color/primarycolor"
app:theme="@style/ThemeOverlay.MaterialComponents.Dark"
app:fabAlignmentMode="center"
app:layout_scrollFlags="scroll|enterAlways"
app:navigationIcon="@drawable/ic_menu_time" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"
app:backgroundTint="#FFFF0000"
app:layout_anchor="@id/bar"
app:rippleColor="#FFFF8888"
app:srcCompat="@drawable/ic_fab_search" />
The behavior of the list scroll is working like a charm for BottomAppBar , but I have big issues with the FloatingActionButton.
As you can see on below screenshot, the BottomAppBar disappear completely, and that's awesome, but I cannot get the same for the FAB. It just moves a little bit at the bottom.
Any idea where I could start looking to fix this? The correct behaviour would be the FAB to follow the Bar and simply disappear
And after the scroll: