From 7e6362cbfbff2eca5b5c32e31cc2adc75e570cfe Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 20 Oct 2018 19:18:30 +0200 Subject: [PATCH] adding some recyclerview related performance optimizations --- app/build.gradle | 2 +- .../gallery/adapters/DirectoryAdapter.kt | 9 +++++---- .../simplemobiletools/gallery/adapters/MediaAdapter.kt | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index fc23a8c8d..8092c114a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -48,7 +48,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.1.6' + implementation 'com.simplemobiletools:commons:5.1.10' implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0' implementation 'androidx.multidex:multidex:2.0.0' 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 df6e1798b..eead88bda 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -66,12 +66,13 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList menu.apply { - findItem(R.id.cab_rename).isVisible = isOneItemSelected() && selectedItems.firstOrNull()?.getIsInRecycleBin() == false - findItem(R.id.cab_open_with).isVisible = isOneItemSelected() + findItem(R.id.cab_rename).isVisible = isOneItemSelected && selectedItems.firstOrNull()?.getIsInRecycleBin() == false + findItem(R.id.cab_open_with).isVisible = isOneItemSelected findItem(R.id.cab_confirm_selection).isVisible = isAGetIntent && allowMultiplePicks && selectedKeys.size > 0 findItem(R.id.cab_restore_recycle_bin_files).isVisible = selectedPaths.all { it.startsWith(activity.filesDir.absolutePath) }