I have a bottom app bar:
<com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/bottomBar"
android:layout_gravity="bottom"
android:layout_height="wrap_content"
android:layout_width="match_parent"
node:backgroundTint="?attr/toolbar"
node:fabAlignmentMode="end"/>
And a FAB Button
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fabAddUser"
android:src="@drawable/add_user"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
node:backgroundTint="?android:attr/colorAccent"
node:fabSize="normal"
node:layout_anchor="@id/bottomBar"
node:rippleColor="?android:attr/colorPrimaryDark"
node:tint="@color/white"/>
When the fab button is present at the bottom right of the screen everything functions as normal. My menu items are on the left side of the screen. When the fab button hides when the user scrolls the menu items move to the right-hand side of the phone. It's really annoying having the menu move from left to right when the FAB button is changing state. Is there any way to keep my menu item buttons always on the left side of the Bottom App Bar.
Thanks in advance!
EDIT #1
I have a recycler view in the layout with id userList. I am using this code to hide the fab button
userList.addOnScrollListener(object: RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
// What Happens When The User Is Scrolling Down//
if (dy > 0) fabAddUser.hide()
// What Happens When The User Is Scrolling Up//
else fabAddUser.show()
// Differ Action To Parent Class//
super.onScrolled(recyclerView, dx, dy)
}
})