0

I've a floating button in my CoordinatorLayout , I want to hide it when I reach to end of my layout .

this is my code :

<?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/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">
<android.support.v4.widget.NestedScrollView
    android:id="@+id/scroll"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginBottom="50dp"
    android:clipToPadding="false"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#EEEEEE"
            android:orientation="vertical">
                    Lots of views here
            </LinearLayout>

    </LinearLayout>
</android.support.v4.widget.NestedScrollView>
<com.software.shell.fab.ActionButton
    android:id="@+id/action_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|end"
    android:layout_marginBottom="50dp"
    android:layout_marginRight="@dimen/fab_margin"
    fab:hide_animation="@anim/fab_roll_to_down"
    fab:show_animation="@anim/fab_roll_from_down" />

</android.support.design.widget.CoordinatorLayout>

when I scroll down and reach to bottom , I want to hide the floating button , How can I make sure that user reaches the end of the layout ?

thanks

donald draper
  • 481
  • 8
  • 23

0 Answers0