Background
I have a header and footer (LinearLayout
) with a RecyclerView
between them.
The problem
I need that the footer stay fixed at the bottom of the screen and the RecyclerView
fills the empty space
What I've tried
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
tools:context="br.com.sigane.coletordifal.activity.EnderecamentoActivity">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Header" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/produtos_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" />
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Footer" />
</LinearLayout>
</LinearLayout>
Also tried to use ConstraintLayout
, but without success