将项目从一个回收器视图(listview)拖放到另一个回收器视图(listview)中 [英] Drag and drop an item from one recyclerview (listview) into another recyclerview (listview)

查看:181
本文介绍了将项目从一个回收器视图(listview)拖放到另一个回收器视图(listview)中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要求,需要将一个项目从一个回收站视图拖动到另一个回收站。

I have a requirement that need to drag an item from one recyclerview into another recyclerview.

我发现一些有用的资源为
ItemTouchHelper 的帮助

I found some some of the useful resource as with the help of ItemTouchHelper

还可以找到一个库来拖放android 这里

Also find a library to drag and drop in android here.

在实现时,可以将项目视图与指针(手指)一起拖动到屏幕上,但不能成功实现我的要求。

While implementation, am able to drag the item view along with the pointer(finger) on the screen, but not able success to achieve my requirement.

如果您有任何此前的经验,请与我分享。

Please share me if you have any previous experience on this.

推荐答案

对于多个列表视图拖放,您可以参考这个
https://github.com/woxblom/DragListView

For multiple list view drag and drop you can refer this https://github.com/woxblom/DragListView

功能


  • 使用
    漂亮的动画重新排序列表,网格或棋盘中的项目。

  • 拖动开始和结束时添加自定义动画。

  • 在拖动开始并以位置结束时获取回调。

  • 禁用并启用拖放

  • 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

RecyclerView中的拖放简单实现如下:

Simple implementation of Drag and Drop in RecyclerView is given below

https://github.com/AleBarreto/DragRecyclerView

这篇关于将项目从一个回收器视图(listview)拖放到另一个回收器视图(listview)中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆