У меня есть вертикальный RecyclerView, где каждая строка является горизонтальным RecyclerView. Что я хочу сделать, так это то, что независимо от того, какой горизонтальный RecyclerViews вы прокручиваете, все остальные будут прокручиваться вместе.
Вот мой код:
Вертикальный просмотр Recycler:
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/purchase_ticket_seats_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:listitem="@layout/view_seats_horizontal"
android:nestedScrollingEnabled="false"/>
Просмотр внутри Vertical Recyclerview:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="50dp"
>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/seats_horizontal_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false"
android:orientation="horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/view_seat"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/seat_row_name" />
<TextView
android:id="@+id/seat_row_name"
android:layout_width="30dp"
android:layout_height="match_parent"
android:text="A"
android:textSize="18sp"
android:paddingStart="5dp"
android:paddingEnd="3dp"
android:paddingTop="7dp"
android:textColor="#fff"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
Я попытался поместить вертикальный просмотрщик в горизонтальный просмотр и отключить горизонтальную прокрутку горизонтальный просмотр. Но не повезло. Я также попытался дать тот же слушатель прокрутки для горизонтального просмотра.
Вот изображение, которого я хочу достичь. Пользователь может прокручивать по вертикали, а если пользователь прокручивает одну горизонтальную строку, другие прокручивают вместе:
![enter image description here](https://i.stack.imgur.com/R8gTf.png)