From 87ebadfdc680c1c841a09f6df585862f3cb28585 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 22 Jun 2018 12:24:43 +0200 Subject: [PATCH] avoid selecting section titles at thumbnails view --- app/build.gradle | 2 +- .../simplemobiletools/gallery/adapters/DirectoryAdapter.kt | 2 ++ .../gallery/adapters/ManageFoldersAdapter.kt | 2 ++ .../gallery/adapters/ManageHiddenFoldersAdapter.kt | 2 ++ .../com/simplemobiletools/gallery/adapters/MediaAdapter.kt | 4 +++- 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 8e3541d06..b4f3b0e09 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,7 +47,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:4.2.9' + implementation 'com.simplemobiletools:commons:4.2.10' implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0' implementation 'com.android.support:multidex:1.0.3' implementation 'it.sephiroth.android.exif:library:1.0.1' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index 3eb4fd15d..375fa60f3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -104,6 +104,8 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList, } } - override fun getSelectableItemCount() = media.size + override fun getSelectableItemCount() = thumbnailItems.filter { it is ThumbnailMedium }.size + + override fun getIsItemSelectable(position: Int) = !isASectionTitle(position) override fun onViewRecycled(holder: ViewHolder) { super.onViewRecycled(holder)