I have a CoordinatorLayoutsupport FloatingActionButtonin which I want to display Snackbar..
<android.support.design.widget.CoordinatorLayout
android:id="@+id/rootView"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
...
</RelativeLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_add_field"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="@dimen/margin_default"
android:layout_marginBottom="@dimen/profile_floating_margin_bottom"
android:layout_marginRight="@dimen/profile_floating_margin_right"
android:clickable="true"
android:src="@drawable/icon_plus"
app:backgroundTint="@color/brand_green"
app:borderWidth="0dp"
app:elevation="@dimen/fac_icon_elevation"/>
</android.support.design.widget.CoordinatorLayout>
Now i'm showing a snackbar like this
Snackbar.make(mRootView, "Something went wrong", Snackbar.LENGHT_SHORT)
.show();
When it is displayed, FAB slides, when it (after LENGHT_SHORT) disappears, FAB slides down, everything works fine.
However, if I scroll through the Snackbar, the FAB moves down without animating the slides . It just blinks to its original position.
Interestingly, if Snackbar has two lines (regardless of whether it has an action or not) and is unscrewed, FAB revives its place with the usual slide animation .
Is this a mistake in android.support.design.widget.CoordinatorLayout
or android.support.design.widget.FloatingActionButton? Any workaround for this?