updating commons to 5.26.27

This commit is contained in:
tibbi 2020-04-26 18:59:38 +02:00
parent 74cd554248
commit 18071f5fe8
4 changed files with 9 additions and 9 deletions

View file

@ -78,7 +78,7 @@ android {
} }
dependencies { 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 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.multidex:multidex:2.0.1'
implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1'

View file

@ -149,8 +149,8 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
} }
private fun checkHideBtnVisibility(menu: Menu, selectedPaths: ArrayList<String>) { private fun checkHideBtnVisibility(menu: Menu, selectedPaths: ArrayList<String>) {
menu.findItem(R.id.cab_hide).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(activity) } menu.findItem(R.id.cab_unhide).isVisible = selectedPaths.any { it.doesThisOrParentHaveNoMedia() }
} }
private fun checkPinBtnVisibility(menu: Menu, selectedPaths: ArrayList<String>) { private fun checkPinBtnVisibility(menu: Menu, selectedPaths: ArrayList<String>) {
@ -240,7 +240,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
val path = it val path = it
activity.handleLockedFolderOpening(path) { success -> activity.handleLockedFolderOpening(path) { success ->
if (success) { if (success) {
if (path.containsNoMedia(activity)) { if (path.containsNoMedia()) {
activity.removeNoMedia(path) { activity.removeNoMedia(path) {
if (activity.config.shouldShowHidden) { if (activity.config.shouldShowHidden) {
updateFolderNames() updateFolderNames()
@ -320,7 +320,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
val affectedPositions = ArrayList<Int>() val affectedPositions = ArrayList<Int>()
val includedFolders = activity.config.includedFolders val includedFolders = activity.config.includedFolders
val newDirs = dirs.filterIndexed { index, directory -> 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) { if (removeDir) {
affectedPositions.add(index) affectedPositions.add(index)
} }

View file

@ -370,7 +370,7 @@ fun Context.storeDirectoryItems(items: ArrayList<Directory>) {
fun Context.checkAppendingHidden(path: String, hidden: String, includedFolders: MutableSet<String>): String { fun Context.checkAppendingHidden(path: String, hidden: String, includedFolders: MutableSet<String>): String {
val dirName = getFolderNameFromPath(path) val dirName = getFolderNameFromPath(path)
return if (path.doesThisOrParentHaveNoMedia(this) && !path.isThisOrParentIncluded(includedFolders)) { return if (path.doesThisOrParentHaveNoMedia() && !path.isThisOrParentIncluded(includedFolders)) {
"$dirName $hidden" "$dirName $hidden"
} else { } else {
dirName dirName
@ -534,7 +534,7 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly:
val hiddenString = resources.getString(R.string.hidden) val hiddenString = resources.getString(R.string.hidden)
filteredDirectories.forEach { 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" "${it.name.removeSuffix(hiddenString).trim()} $hiddenString"
} else { } else {
it.name.removeSuffix(hiddenString).trim() it.name.removeSuffix(hiddenString).trim()

View file

@ -36,7 +36,7 @@ fun String.shouldFolderBeVisible(excludedPaths: MutableSet<String>, includedPath
val containsNoMedia = if (showHidden) { val containsNoMedia = if (showHidden) {
false false
} else { } else {
file.containsNoMedia(context) file.containsNoMedia()
} }
return if (!showHidden && containsNoMedia) { return if (!showHidden && containsNoMedia) {
@ -50,7 +50,7 @@ fun String.shouldFolderBeVisible(excludedPaths: MutableSet<String>, includedPath
} else if (!showHidden && file.isDirectory && file.canonicalFile == file.absoluteFile) { } else if (!showHidden && file.isDirectory && file.canonicalFile == file.absoluteFile) {
var containsNoMediaOrDot = containsNoMedia || contains("/.") var containsNoMediaOrDot = containsNoMedia || contains("/.")
if (!containsNoMediaOrDot) { if (!containsNoMediaOrDot) {
containsNoMediaOrDot = file.doesParentHaveNoMedia(context) containsNoMediaOrDot = file.doesParentHaveNoMedia()
} }
!containsNoMediaOrDot !containsNoMediaOrDot
} else { } else {