I'm using a CoordinatorLayout to keep my Floating Action Button above the Snackbar, which works great. ...But only for the first Snackbar. When a second one is created, while the first one is still there, the FAB slides under it.
I'm using this in a RecyclerView in which I can remove items. When an item is removed, a "Undo" Snackbar appears. So when you delete some items one after another, the visible Snackbar is replaced by a new one (which causes the FAB behaviour)
Do you know a solution to keep the FAB above new Snackbars?
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:fab="http://schemas.android.com/tools"
android:id="@+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:backgroundTint="@color/background_grey"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" />
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:elevation="6dp"
android:src="@drawable/ic_add_white_36dp"
app:borderWidth="0dp"
app:fabSize="normal"
app:pressedTranslationZ="10dp"
app:rippleColor="@color/abc_primary_text_material_dark" />
</android.support.design.widget.CoordinatorLayout>
This is how it looks after I delete on item
...and then after I delete another item