Я создаю приложение для Android. Где мне нужно реализовать список вкладок, например, стиль меню Flipkart Filter. У меня есть два вида recyler (с возможностью выбора нескольких вариантов) по горизонтали в LinerLayout, как это. Мой первый recyclerview будет иметь категории списка, а onclick каждой категории второй recyclerview будет заполнен несколькими вариантами. Я могу сделать это с двумя различными адаптерами для каждого.Опция фильтра для нескольких категорий в android
После выбора нескольких элементов во втором recyclerview снова я выберу еще одну категорию в первом recyclerview, а затем seconnd recylcerview будет обновляться новыми данными. Но как я могу сохранить предыдущий выбор?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:background="@color/base_background"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/app"
android:text="Apply Filter"
android:layout_margin="10dp"
android:textSize="20sp"
android:layout_gravity="center_horizontal"/>
<LinearLayout
android:id="@+id/LinearLayout02"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_alignParentBottom="true">
<Button
android:id="@+id/Button02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" android:text="Clear Filters">
</Button>
<Button
android:id="@+id/Button03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Apply">
</Button>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:orientation="horizontal"
android:layout_height="fill_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/View01"
android:layout_width="0dp"
android:clipToPadding="false"
android:layout_height="fill_parent"
android:layout_marginRight="5dp"
android:layout_weight="0.4"
/>
<android.support.v7.widget.RecyclerView
android:id="@+id/View02"
android:layout_width="0dp"
android:clipToPadding="false"
android:scrollbars="vertical"
android:layout_height="fill_parent"
android:layout_marginRight="5dp"
android:layout_weight="0.6"
/>
</LinearLayout>