Q: Android RecyclerView height to match_parent minus fixed height I have a couple of RecyclerViews that need to co-exist in a vertical layout. The top one can scroll horizontally and the bottom one vertically. However, the user should be able to scroll both of them vertically. To this end I have followed the first solution of this question. That worked to an extent, but I need to be able to set the height of the bottom recycler view to match the height of its parent view (which is almost as tall as the device) minus the height of the top recycler view (and some TextViews). 
Here is the layout code:
<ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:padding="10dp"
                android:text="Txt1"
                android:textSize="18dp"
                android:textColor="@android:color/darker_gray"
                android:textAlignment="center"/>

            <com.kwippit.android.uicomponents.EmptyRecyclerView
                android:id="@+id/horizontal_recycler_view"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:padding="10dp"
                android:text="Txt2"
                android:textSize="18dp"
                android:textColor="@android:color/darker_gray"
                android:textAlignment="center"/>

            <android.support.v4.widget.SwipeRefreshLayout
                android:id="@+id/refresh"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <com.kwippit.android.uicomponents.EmptyRecyclerView
                    android:id="@+id/grid_recycler_view"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"/>

            </android.support.v4.widget.SwipeRefreshLayout>

        </LinearLayout>

    </ScrollView>

I have tried to set the bottom recycler view to a specific height but that did not look quite right when scrolling because the number of items it displays is unknown beforehand and the top recycler view remains on screen instead of getting hidden while scrolling downwards.
Any ideas? Thanks.

A: I didn't get exactly your problem, but maybe this library will help you deal with the Recycler Views:
https://github.com/lucasr/twoway-view
I hope it helps :) 
