From d09070b61dec49518ef2c5240874088e66920245 Mon Sep 17 00:00:00 2001 From: Isira Seneviratne Date: Sun, 28 Feb 2021 14:48:06 +0530 Subject: [PATCH] Fix crash when reordering channel groups. --- .../local/subscription/item/FeedGroupReorderItem.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/item/FeedGroupReorderItem.kt b/app/src/main/java/org/schabi/newpipe/local/subscription/item/FeedGroupReorderItem.kt index 48b06b08a..74e481c4f 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/item/FeedGroupReorderItem.kt +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/item/FeedGroupReorderItem.kt @@ -33,9 +33,13 @@ data class FeedGroupReorderItem( override fun bind(viewBinding: FeedGroupReorderItemBinding, position: Int) { viewBinding.groupName.text = name viewBinding.groupIcon.setImageResource(icon.getDrawableRes(viewBinding.root.context)) - viewBinding.handle.setOnTouchListener { _, event -> + } + + override fun bind(viewHolder: GroupieViewHolder, position: Int, payloads: MutableList) { + super.bind(viewHolder, position, payloads) + viewHolder.binding.handle.setOnTouchListener { _, event -> if (event.actionMasked == MotionEvent.ACTION_DOWN) { - dragCallback.startDrag(GroupieViewHolder(viewBinding)) + dragCallback.startDrag(viewHolder) return@setOnTouchListener true }