1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-06-26 07:03:20 +00:00

Merge pull request #5718 from Isira-Seneviratne/Fix_channel_group_crash

Fix crash when reordering channel groups.
This commit is contained in:
Tobi 2021-03-04 22:07:02 +01:00 committed by GitHub
commit f0d978b4c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<FeedGroupReorderItemBinding>, position: Int, payloads: MutableList<Any>) {
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
}