سلام و عرض ادب . با اینکه روت فایل من coordinator هست ولی اسنک بار روی FloatActionButton میاد و هیچ انیمیشن هم که به بالا دکمه رو انتقال بده اجرا نمیشه.’
سلام وقت بخیر
اتربیوت app:layout_behavior رو به اشتباه به FloatActionButton اضافه کردید.
فایل تصحیح شده پیوست شد.
app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior"
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"
app:title="Android Expert"
app:titleTextColor="@android:color/white"/>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include layout="@layout/item_text"/>
<include layout="@layout/item_text"/>
<include layout="@layout/item_text"/>
<include layout="@layout/item_text"/>
<include layout="@layout/item_text"/>
<include layout="@layout/item_text"/>
<include layout="@layout/item_text"/>
<include layout="@layout/item_text"/>
<include layout="@layout/item_text"/>
<include layout="@layout/item_text"/>
<include layout="@layout/item_text"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat = "@drawable/layer_vector_ic"
android:layout_gravity="bottom|end"
android:layout_marginEnd="16dp"
android:layout_marginBottom="20dp"
tools:ignore="VectorDrawableCompat"
app:tint="@android:color/white"
app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior"
app:fabSize="auto"
app:rippleColor="#8AFFFFFF"
/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>