avoid selecting section titles at thumbnails view

This commit is contained in:
tibbi 2018-06-22 12:24:43 +02:00
parent 2e178ad645
commit 87ebadfdc6
5 changed files with 10 additions and 2 deletions

View file

@ -47,7 +47,7 @@ ext {
} }
dependencies { 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.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'com.android.support:multidex:1.0.3' implementation 'com.android.support:multidex:1.0.3'
implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1'

View file

@ -104,6 +104,8 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
override fun getSelectableItemCount() = dirs.size override fun getSelectableItemCount() = dirs.size
override fun getIsItemSelectable(position: Int) = true
override fun onViewRecycled(holder: ViewHolder) { override fun onViewRecycled(holder: ViewHolder) {
super.onViewRecycled(holder) super.onViewRecycled(holder)
if (!activity.isActivityDestroyed()) { if (!activity.isActivityDestroyed()) {

View file

@ -39,6 +39,8 @@ class ManageFoldersAdapter(activity: BaseSimpleActivity, var folders: ArrayList<
override fun getSelectableItemCount() = folders.size override fun getSelectableItemCount() = folders.size
override fun getIsItemSelectable(position: Int) = true
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.item_manage_folder, parent) override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.item_manage_folder, parent)
override fun onBindViewHolder(holder: ViewHolder, position: Int) { override fun onBindViewHolder(holder: ViewHolder, position: Int) {

View file

@ -41,6 +41,8 @@ class ManageHiddenFoldersAdapter(activity: BaseSimpleActivity, var folders: Arra
override fun getSelectableItemCount() = folders.size override fun getSelectableItemCount() = folders.size
override fun getIsItemSelectable(position: Int) = true
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.item_manage_folder, parent) override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.item_manage_folder, parent)
override fun onBindViewHolder(holder: ViewHolder, position: Int) { override fun onBindViewHolder(holder: ViewHolder, position: Int) {

View file

@ -145,7 +145,9 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Medium>,
} }
} }
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) { override fun onViewRecycled(holder: ViewHolder) {
super.onViewRecycled(holder) super.onViewRecycled(holder)