Button that disappears when scrolling the screen

0

Hello everyone, could you help me? I am wanting to make the button of my application hide when I roll the screen up, and appear when I scroll down. Same as the image application below, when we scroll the screen up the button disappears, when we scroll down it reappears. Unfortunately I have no idea how. Could someone help me or point me something?

You are inside an android.support.design.widget.CoordinatorLayout

<?xml version="1.0" encoding="utf-8"?>

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.PopupOverlay" />

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

<include layout="@layout/content_home" />

<Button
    android:id="@+id/btnAd"
    android:layout_width="180dp"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|center"
    android:layout_marginBottom="30dp"
    android:background="@drawable/btnad"
    android:drawableStart="@drawable/ic_camera_alt_black_24dp"
    android:padding="15dp"
    android:textStyle="bold"
    android:text="@string/btnad"
    android:textColor="@color/background_color" />

    
asked by anonymous 17.11.2018 / 22:22

0 answers