mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 16:40:32 +00:00
Fix crash when reordering channel groups.
This commit is contained in:
parent
d6855a6b50
commit
d09070b61d
@ -33,9 +33,13 @@ data class FeedGroupReorderItem(
|
|||||||
override fun bind(viewBinding: FeedGroupReorderItemBinding, position: Int) {
|
override fun bind(viewBinding: FeedGroupReorderItemBinding, position: Int) {
|
||||||
viewBinding.groupName.text = name
|
viewBinding.groupName.text = name
|
||||||
viewBinding.groupIcon.setImageResource(icon.getDrawableRes(viewBinding.root.context))
|
viewBinding.groupIcon.setImageResource(icon.getDrawableRes(viewBinding.root.context))
|
||||||
viewBinding.handle.setOnTouchListener { _, event ->
|
}
|
||||||
|
|
||||||
|
override fun bind(viewHolder: GroupieViewHolder<FeedGroupReorderItemBinding>, position: Int, payloads: MutableList<Any>) {
|
||||||
|
super.bind(viewHolder, position, payloads)
|
||||||
|
viewHolder.binding.handle.setOnTouchListener { _, event ->
|
||||||
if (event.actionMasked == MotionEvent.ACTION_DOWN) {
|
if (event.actionMasked == MotionEvent.ACTION_DOWN) {
|
||||||
dragCallback.startDrag(GroupieViewHolder(viewBinding))
|
dragCallback.startDrag(viewHolder)
|
||||||
return@setOnTouchListener true
|
return@setOnTouchListener true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user