From df86b5d9ae45be2ab99e86b801df3af7a2d56fe5 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 30 Nov 2017 14:58:27 +0100 Subject: [PATCH] update commons to 3.0.5 --- app/build.gradle | 2 +- .../gallery/adapters/DirectoryAdapter.kt | 18 +++++++++--------- .../gallery/adapters/ManageFoldersAdapter.kt | 4 ++-- .../gallery/adapters/MediaAdapter.kt | 18 +++++++++--------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 01f498aa8..91b49f6dd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,7 +47,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.0.3' + implementation 'com.simplemobiletools:commons:3.0.5' implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.8.0' implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.0' implementation 'com.android.support:multidex:1.0.2' 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 74a25b4a9..92b09d15d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -57,8 +57,8 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList + setupView(itemView, dir) } bindViewHolder(holder, position, view) } @@ -93,6 +93,13 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList) { dirs = newDirs selectableItemCount = dirs.size diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/ManageFoldersAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/ManageFoldersAdapter.kt index 675490a0c..5d671bc29 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/ManageFoldersAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/ManageFoldersAdapter.kt @@ -43,8 +43,8 @@ class ManageFoldersAdapter(activity: BaseSimpleActivity, var folders: ArrayList< override fun onBindViewHolder(holder: ViewHolder, position: Int) { val folder = folders[position] - val view = holder.bindView(folder) { - setupView(it, folder) + val view = holder.bindView(folder) { itemView, layoutPosition -> + setupView(itemView, folder) } bindViewHolder(holder, position, view) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index c1a4a2c1d..116858a5f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -57,8 +57,8 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, override fun onBindViewHolder(holder: MyRecyclerViewAdapter.ViewHolder, position: Int) { val medium = media[position] - val view = holder.bindView(medium, !allowMultiplePicks) { - setupView(it, medium) + val view = holder.bindView(medium, !allowMultiplePicks) { itemView, layoutPosition -> + setupView(itemView, medium) } bindViewHolder(holder, position, view) } @@ -93,6 +93,13 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, } } + override fun onViewRecycled(holder: ViewHolder?) { + super.onViewRecycled(holder) + if (!activity.isActivityDestroyed()) { + Glide.with(activity).clear(holder?.itemView?.medium_thumbnail) + } + } + private fun checkHideBtnVisibility(menu: Menu) { var hiddenCnt = 0 var unhiddenCnt = 0 @@ -234,13 +241,6 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, return selectedMedia } - override fun onViewRecycled(holder: ViewHolder?) { - super.onViewRecycled(holder) - if (!activity.isActivityDestroyed()) { - Glide.with(activity).clear(holder?.itemView?.medium_thumbnail) - } - } - fun updateMedia(newMedia: ArrayList) { media = newMedia selectableItemCount = media.size