I cannot able to find a solution to hide Floating Action Button when scrolled on ScrollView. I can find some solutions but all of them are for Java, there is no valid solution for Kotlin.
You can see my layout below:
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<ScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:context=".ZekatFragment">
<!-- MAIN CONTENT -->
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/floating_action_button"
style="@style/Widget.MaterialComponents.FloatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_marginBottom="10dp"
android:layout_marginEnd="5dp"
app:backgroundTint="@color/colorPrimary"
app:fabSize="mini"
app:srcCompat="@drawable/ic_arrow_downward_white"
app:tint="#FFFFFF" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>