From 18071f5fe8ba5449dc06834ce19ad67bf788e903 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 26 Apr 2020 18:59:38 +0200 Subject: [PATCH] updating commons to 5.26.27 --- app/build.gradle | 2 +- .../gallery/pro/adapters/DirectoryAdapter.kt | 8 ++++---- .../simplemobiletools/gallery/pro/extensions/Context.kt | 4 ++-- .../simplemobiletools/gallery/pro/extensions/String.kt | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d88ea2484..dd442ccd5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -78,7 +78,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.26.26' + implementation 'com.simplemobiletools:commons:5.26.27' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'androidx.multidex:multidex:2.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1' 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 230216da3..224c6556c 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 @@ -149,8 +149,8 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList) { - menu.findItem(R.id.cab_hide).isVisible = selectedPaths.any { !it.doesThisOrParentHaveNoMedia(activity) } - menu.findItem(R.id.cab_unhide).isVisible = selectedPaths.any { it.doesThisOrParentHaveNoMedia(activity) } + menu.findItem(R.id.cab_hide).isVisible = selectedPaths.any { !it.doesThisOrParentHaveNoMedia() } + menu.findItem(R.id.cab_unhide).isVisible = selectedPaths.any { it.doesThisOrParentHaveNoMedia() } } private fun checkPinBtnVisibility(menu: Menu, selectedPaths: ArrayList) { @@ -240,7 +240,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList if (success) { - if (path.containsNoMedia(activity)) { + if (path.containsNoMedia()) { activity.removeNoMedia(path) { if (activity.config.shouldShowHidden) { updateFolderNames() @@ -320,7 +320,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList() val includedFolders = activity.config.includedFolders val newDirs = dirs.filterIndexed { index, directory -> - val removeDir = directory.path.doesThisOrParentHaveNoMedia(activity) && !includedFolders.contains(directory.path) + val removeDir = directory.path.doesThisOrParentHaveNoMedia() && !includedFolders.contains(directory.path) if (removeDir) { affectedPositions.add(index) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt index 4af66f86e..99674593e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt @@ -370,7 +370,7 @@ fun Context.storeDirectoryItems(items: ArrayList) { fun Context.checkAppendingHidden(path: String, hidden: String, includedFolders: MutableSet): String { val dirName = getFolderNameFromPath(path) - return if (path.doesThisOrParentHaveNoMedia(this) && !path.isThisOrParentIncluded(includedFolders)) { + return if (path.doesThisOrParentHaveNoMedia() && !path.isThisOrParentIncluded(includedFolders)) { "$dirName $hidden" } else { dirName @@ -534,7 +534,7 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly: val hiddenString = resources.getString(R.string.hidden) filteredDirectories.forEach { - it.name = if (it.path.doesThisOrParentHaveNoMedia(this) && !it.path.isThisOrParentIncluded(includedPaths)) { + it.name = if (it.path.doesThisOrParentHaveNoMedia() && !it.path.isThisOrParentIncluded(includedPaths)) { "${it.name.removeSuffix(hiddenString).trim()} $hiddenString" } else { it.name.removeSuffix(hiddenString).trim() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/String.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/String.kt index 1408d33fc..0aa790df9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/String.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/String.kt @@ -36,7 +36,7 @@ fun String.shouldFolderBeVisible(excludedPaths: MutableSet, includedPath val containsNoMedia = if (showHidden) { false } else { - file.containsNoMedia(context) + file.containsNoMedia() } return if (!showHidden && containsNoMedia) { @@ -50,7 +50,7 @@ fun String.shouldFolderBeVisible(excludedPaths: MutableSet, includedPath } else if (!showHidden && file.isDirectory && file.canonicalFile == file.absoluteFile) { var containsNoMediaOrDot = containsNoMedia || contains("/.") if (!containsNoMediaOrDot) { - containsNoMediaOrDot = file.doesParentHaveNoMedia(context) + containsNoMediaOrDot = file.doesParentHaveNoMedia() } !containsNoMediaOrDot } else {