From 53f3cfe02ebb4b7e9ec6edc2eff142ea1f3740ef Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 14 May 2021 20:01:47 +0200 Subject: [PATCH] initiate touchhelper at folders only when going to drag & drop --- .../gallery/pro/adapters/DirectoryAdapter.kt | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt index 973c0e218..28401776a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt @@ -68,7 +68,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList() private var isDragAndDropping = false - private var startReorderDragListener: StartReorderDragListener + private var startReorderDragListener: StartReorderDragListener? = null private var showMediaCount = config.showFolderMediaCount private var folderStyle = config.folderStyle @@ -77,15 +77,6 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList if (event.action == MotionEvent.ACTION_DOWN) { - startReorderDragListener.requestDrag(holder) + startReorderDragListener?.requestDrag(holder) } false }