Drag and Drop between two RecyclerView
Asked Answered
C

5

27

Is it possible to have feature like drag and drop between two different RecyclerView?

I found library for drag and drop within RecyclerView. Please help me to improve this functionality.

Cavil answered 17/4, 2015 at 4:45 Comment(4)
Did you got any solution for your problem? I also need the same.Embower
sorry i moved to some other workCavil
Would be awesome if someone puts an answer to this..Markham
Is anyone found solution of this problem, I m also trying to move item between 2 different RecyclerView. @bumbaDoorstone
C
15

I had a similar requirement in one of our projects. You can check out the sample code that I have uploaded here - RecyclerView Drag and Drop

It is a very basic code that matches your requirement - Drag and drop within a single recyclerview as well as between two different recyclerviews.

Hope this helps.

Campobello answered 30/6, 2016 at 14:47 Comment(3)
Thanks for the update. It is working fine without any ItemAnimation.Cavil
@Cavil did you find any solution with adding ItemAnimation ?Hitherward
how will you manage if no data available in second list. this is working only when items available in both list.Dedra
C
19

Check out my code sample on GitHub. It will help you understand how to Drag and Drop between two RecyclerViews.

Caviar answered 4/2, 2017 at 5:52 Comment(3)
Doesn't work anymore, gives gradle errors. RipDusa
@Dusa The example does work. It requires small modifications and then it runs just fine.Impresario
please, Could you update the project or show some steps to run successfully in 2022?Mouseear
C
15

I had a similar requirement in one of our projects. You can check out the sample code that I have uploaded here - RecyclerView Drag and Drop

It is a very basic code that matches your requirement - Drag and drop within a single recyclerview as well as between two different recyclerviews.

Hope this helps.

Campobello answered 30/6, 2016 at 14:47 Comment(3)
Thanks for the update. It is working fine without any ItemAnimation.Cavil
@Cavil did you find any solution with adding ItemAnimation ?Hitherward
how will you manage if no data available in second list. this is working only when items available in both list.Dedra
S
6

No need to use third party library's,Support library now supporting the drag and drop of recyleview, may be this article will help you

https://medium.com/@ipaulpro/drag-and-swipe-with-recyclerview-6a6f0c422efd

Shatzer answered 28/7, 2015 at 12:1 Comment(0)
E
3

This lib can help you. Check sample example, it does what you asked. It has a BoardView, where you can put several lists.

YouTube demo-video: https://youtu.be/tNgevYpyA9E?t=30

Features

  • Re-order items in a list, grid or board by dragging and dropping with nice animations.

  • Add custom animations when the drag is starting and ending.

  • Get a callback when a drag is started and ended with the position.

  • Disable and enable drag and drop

Elicia answered 29/9, 2016 at 15:22 Comment(1)
Thanks this is exactly what i am looking forCavil
K
0

I had the same problem in one of my projects. I wanted the solution to be as easy to use as possible, so I prepared my own library.

If you're looking to implement drag and drop functionality across multiple RecyclerViews in your Android application, I highly recommend checking out the Unbound Drag & Drop library. Unlike the default behavior which restricts drag and drop actions to a single RecyclerView, this library allows seamless movement of items between different RecyclerViews, providing a more flexible and intuitive user experience.

Kra answered 26/6, 2024 at 7:59 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.