-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
拖拽替换回调问题 #447
Labels
提议
New feature or request
Comments
感觉你说的解决方案可以, 如果你有空或者希望成为brv贡献者可以提一个pr 如果没想法我有空会发布该版本 |
无法复现你描述的问题, 你录屏看下吧 /**
* 拖拽移动超过其他item时, 其返回值表示是否已经拖拽替换(会触发函数onMoved)
* @return 返回false 禁止被拖拽交换移动
*/
override fun onMove(
recyclerView: RecyclerView,
source: RecyclerView.ViewHolder,
target: RecyclerView.ViewHolder,
): Boolean 理论上你没有超过其他item不会回调 |
liangjingkanji
added
无法复现
This doesn't seem right
and removed
Bug
Something isn't working
labels
Jul 15, 2024
20240716_102457.mp4没有拖拽交换移动也触发了onDrag事件 |
原来是错误触发 |
liangjingkanji
added
提议
New feature or request
and removed
无法复现
This doesn't seem right
labels
Jul 16, 2024
liangjingkanji
added a commit
that referenced
this issue
Jul 16, 2024
已经修复发布了 通过记录拖拽起始位置, 实现拖拽起始位置等于目标位置则属于无效移动, 不回调onDrag方法 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题描述
拖拽回调事件
DefaultItemTouchCallback中onDrag第一次交换后松手没问题
如果第二次只是长按立马松开还是会触发onDrag事件,两个item还是上次交换的item
这个时候是否可以在onDrag后把sourceViewHolder, targetViewHolder置为null呢
期望结果
在不进行交换的时候不触发onDrag事件
如何复现
第二次只是长按立马松开
截图
异常堆栈信息或者手机截图/视频(拖拽到输入框即可上传)
版本
The text was updated successfully, but these errors were encountered: