У меня есть CoordinatorLayout
с поддержкой FloatingActionButton
, в котором я хочу отображать 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>
Теперь я показываю Snackbar вот так
Snackbar.make(mRootView, "Something went wrong", Snackbar.LENGHT_SHORT)
.show();
Когда он отображается, FAB скользит вверх, когда он (после LENGHT_SHORT) исчезает, FAB скользит вниз, все работает нормально.
Однако, если я смахиваю Snackbar в сторону, FAB перемещается вниз без слайд-анимации. Он просто мигает в исходное положение.
Интересно, что если Snackbar состоит из двух строк (независимо от того, есть ли у него действие или нет) и смахивается, FAB правильно возвращается на свое место с обычной анимацией слайдов .
Это ошибка в android.support.design.widget.CoordinatorLayout
или android.support.design.widget.FloatingActionButton
? Какое-либо обходное решение для этого?