From 87d845c1378fd9b9042fa67bede41534aed199df Mon Sep 17 00:00:00 2001 From: Naveen Date: Mon, 4 Sep 2023 10:02:18 +0530 Subject: [PATCH] Add back drag listeners! --- .../musicplayer/adapters/BaseMusicAdapter.kt | 4 ++++ .../musicplayer/adapters/ExcludedFoldersAdapter.kt | 4 ++++ .../simplemobiletools/musicplayer/adapters/TracksAdapter.kt | 2 -- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/musicplayer/adapters/BaseMusicAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/musicplayer/adapters/BaseMusicAdapter.kt index a95095fb..8d49626a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/musicplayer/adapters/BaseMusicAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/musicplayer/adapters/BaseMusicAdapter.kt @@ -33,6 +33,10 @@ abstract class BaseMusicAdapter( val placeholderBig by lazy { resources.getBiggerPlaceholder(textColor) } open val cornerRadius by lazy { resources.getDimension(com.simplemobiletools.commons.R.dimen.rounded_corner_radius_small).toInt() } + init { + setupDragListener(true) + } + override fun getItemCount() = items.size override fun getSelectableItemCount() = items.size diff --git a/app/src/main/kotlin/com/simplemobiletools/musicplayer/adapters/ExcludedFoldersAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/musicplayer/adapters/ExcludedFoldersAdapter.kt index bff68b6f..79274bb2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/musicplayer/adapters/ExcludedFoldersAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/musicplayer/adapters/ExcludedFoldersAdapter.kt @@ -24,6 +24,10 @@ class ExcludedFoldersAdapter( private val config = activity.config + init { + setupDragListener(true) + } + override fun getActionMenuId() = com.simplemobiletools.commons.R.menu.cab_remove_only override fun prepareActionMode(menu: Menu) {} diff --git a/app/src/main/kotlin/com/simplemobiletools/musicplayer/adapters/TracksAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/musicplayer/adapters/TracksAdapter.kt index 3a0615ce..40f80ed3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/musicplayer/adapters/TracksAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/musicplayer/adapters/TracksAdapter.kt @@ -42,8 +42,6 @@ class TracksAdapter( private var startReorderDragListener: StartReorderDragListener init { - setupDragListener(true) - touchHelper = ItemTouchHelper(ItemMoveCallback(this)) touchHelper!!.attachToRecyclerView(recyclerView)