0
I have a Fragment with Coordinator layout, recyclerview and a Float Action Button, and in the view that calls this Fragment has a tablayout that hides and appears as you go up or down the Recycler view, I have tried several ways to leave Fab fixed in the footer, but anyway it always rises when slips the view Recycler
follows below the code of Fragment:
<FrameLayout 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:id="@+id/frmLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="br.com.julioantonini.meuchat.ContatosFragment">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerContatos"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginBottom="70dp"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
app:elevation="1dp"
app:srcCompat="@drawable/ic_action_add"
app:layout_anchor="@id/recyclerContatos"
app:layout_anchorGravity="bottom|right|end"/>
and below the code of Activity:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_height="wrap_content"
android:layout_width="match_parent">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
app:layout_scrollFlags="scroll|enterAlways"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary" />
<android.support.design.widget.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
app:tabIndicatorColor="@color/colorTab"/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_below="@id/appbar"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
What is the xml of your Activity? Updates the question...
– Danilo de Oliveira
I added the code of acitivity
– Julio Antonini