Реализация сворачивающейся логики панели инструментов в Recyclerview - PullRequest
0 голосов
/ 03 ноября 2019

У меня есть следующий XML-код -

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MainActivity">


    <TextView
        android:id="@+id/textView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Dummy Text"
        android:textSize="50sp" />

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/horizontalRecycler"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
        tools:listitem="@layout/row_item" />

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/verticalRecycler"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:listitem="@layout/row_item" />


</LinearLayout>

, который выглядит следующим образом -

enter image description here

Чего я хочу достичьта же функциональность всей сворачивающейся панели инструментов, но с моим взглядом переработчика. Я хочу, чтобы представления внутри моего горизонтального окна рециркуляции были сжаты до верхнего предела и прокручивались сами, все это происходит при прокрутке нижней вертикальной компоновки вниз.

Как мне добиться такого поведения?

Я загрузил gif, чтобы продемонстрировать, чего я хочу достичь -

https://gph.is/g/4LggR0R

...