I have a HomeActivity which has tabs containing fragments. In which BoardFragment has children RecyclerView and a RelativeLayout(at bottom). My Toolbar collapses when I scroll up. But my RealtiveLayout on the bottom also coordinate with them. Only the upper part part of it is shown on oncreate. It shows up completely when I scroll up.
Here are the sreenshots.
HomeActivity.
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/appbar_padding_top"
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:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_menu_white_24dp"
/>
<Spinner
android:id="@+id/spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="150dp"
app:popupTheme="@style/AppTheme.PopupOverlay"
/>
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/container"
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="end|bottom"
android:layout_margin="@dimen/fab_margin"
android:src="@android:drawable/ic_input_add"
android:visibility="invisible" />
Board Fragment.
<FrameLayout 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"
tools:context="io.sleeko.fragment.BoardFragment"
android:background="#dadada">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/boardMainContentList"
>
</android.support.v7.widget.RecyclerView>
<com.github.rahatarmanahmed.cpv.CircularProgressView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/spinningProgressView"
android:layout_width="36dp"
android:layout_height="36dp"
android:padding="4dp"
android:background="@drawable/white_circle_drawable"
android:layout_centerHorizontal="true"
android:layout_marginTop="150dp"
app:cpv_thickness="3dp"
app:cpv_color="#ff161a73"
app:cpv_animAutostart="true"
app:cpv_indeterminate="true"
android:elevation="4dp"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="96dp"
android:layout_alignParentBottom="true"
android:duplicateParentState="true"
android:background="#ffffff"
android:padding="8dp"
android:id="@+id/sendMessageContainer"
>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Write a Message"
android:padding="8dp"
android:background="@android:color/transparent"
/>
<android.support.design.widget.FloatingActionButton
android:layout_height="wrap_content"
android:layout_width="wrap_content"
app:fabSize="mini"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:id="@+id/sendButton"
android:src="@drawable/ic_send_white_24dp"
/>
</RelativeLayout>
</RelativeLayout>
Can anyone help me solve this? Thanks.