Ich habe eine verschachtelte RecyclerView, in der die übergeordnete Ansicht ist ein CardView (gif). Ich versuche, einen Swipe zu implementieren, um die Aktion von Paul Burke (link) zu löschen. Die Aktion geht gut in den inneren RecyclerView über, verursacht aber einen Sprung der äußeren CardView-Höhe (wrap_content). Gibt es eine Möglichkeit, den CardView-Übergang mit dem RecyclerView zu machen?CardView Höhe wechselt nicht mit verschachtelten RecyclerView
Inner RecyclerView:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/card_tasks_root"
android:orientation="vertical"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/card_tasks_title"
android:padding="8dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="section placeholder" />
<android.support.v7.widget.CardView
android:layout_marginBottom="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fff"
android:elevation="2dp">
<android.support.v7.widget.RecyclerView
android:id="@+id/card_tasks_rv"
android:background="#E0E0E0"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</android.support.v7.widget.CardView>
</LinearLayout>
Inner Item:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:background="#fff"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="7dp"
android:paddingBottom="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/item_task_project"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="12sp"
tools:text="Project name"
/>
<TextView
android:id="@+id/item_task_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="3dp"
android:paddingBottom="5dp"
android:textSize="18dp"
android:textColor="#757575"
tools:text="Task name"/>
</LinearLayout>
<View android:id="@+id/item_task_divider" style="@style/Divider"/>
</LinearLayout>
Der CardView ist ein (möglicherweise redundanter?) Container für den verschachtelten RecyclerView. Wenn ich das CardView in den inneren Gegenstand legen würde, würde es nicht für jeden Gegenstand eine Kartenansicht erstellen? Danke für Ihre Antwort. –