I have a fragment with 2 cardviews with multiple controls within.
below the second cardview I have a recyclerview, this works perfect.
the problem is that the recyclerview starts very bottom of the screen, and scroll the recylcerview is very small.
previously used a listview, and this kept me fit your content and thus make scroll across the screen at once, but with recylclerview can not.
How to make when I scroll in the recyclerview, controls go up like parallax effect?
EDIT: more clear, imagine 2 cardviews in a fragment, these occupy 80% of the screen, above of these, a recyclerview with a list of 100 items, but the scroll is so tiny...the listview let me adapt to the "content" and scroll the entire screen at once.
this is my XML layout:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/svScroll"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<include
android:id="@+id/cvCampos1"
layout="@layout/ctlcabeceralibreta" />
<include
android:id="@+id/cvCampos2"
layout="@layout/ctlcabeceralibreta2" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rvRegistros"
android:layout_width="fill_parent"
android:layout_height="1000dp"
android:layout_below="@id/cvCampos2"
android:scrollbars="vertical" />
</RelativeLayout>
</ScrollView>
this is the screenshoot:

In the above case what you need to do is to use multiple ViewHolders in the same recyclerview.
I see that you have three type of layouts there. The first two cards and other layouts in your recyclerview.
RecyclerView with multiple View Types gives you an example how to use multiple viewtypes in a simple recyclerview.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With