h6ah4i / android-advancedrecyclerview

RecyclerView extension library which provides advanced features. (ex. Google's Inbox app like swiping, Play Music app like drag and drop sorting)
https://advancedrecyclerview.h6ah4i.com/
Apache License 2.0
5.32k stars 860 forks source link

Grab ExpandableDraggableItemAdapter type of Recyclerview into normal Recyclerview, then it can not drag items #505

Open MaoTouWang opened 4 years ago

MaoTouWang commented 4 years ago

I use a ExpandableDraggableItemAdapter to create a Recyclerview to be able to drag and expand group item on my main view. It works fine. But i put this expandableDraggable Recyclerview into another normal Recyclerview. The normal Recyclerview adapter is to extend RecyclerView.Adapter. Then my expandableDraggable recyclerview can not drag anymore, only can expand. The reason i need to use normal recyclerview to grab expandableDraggable recyclerview is that i have another DraggableItemAdapter recyclerview is on the bottom of expandableDraggable recycleview. both two need to swap position flexibly. Can anyone give me a hint or tips there is possible to use expandableDraggable advanced recyclerview inside another recyclerview?

main_layout.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">

<androidx.recyclerview.widget.RecyclerView
    android:id="@+id/normal_recycler_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

normal_recycler_item.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content">

<androidx.recyclerview.widget.RecyclerView
    android:id="@+id/expand_drag_recycler_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:clipChildren="false"
    android:clipToPadding="false"
    android:scrollbars="vertical"
    android:scrollbarStyle="outsideOverlay"/>