diff --git a/app/build.gradle b/app/build.gradle index 9dbe061d3..e769648e5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -62,7 +62,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.17.19' + implementation 'com.simplemobiletools:commons:5.18.0' 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/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index 2535031c3..cf92d6430 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -1119,8 +1119,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { if (!File(it.path).exists()) { invalidDirs.add(it) } else if (it.path != config.tempFolderPath) { - val children = File(it.path).list()?.asList() - val hasMediaFile = children?.any { it?.isMediaFile() == true } ?: false + val children = File(it.path).listFiles()?.asList() + val hasMediaFile = children?.any { + it?.isMediaFile() == true || (it.isDirectory && it.name.startsWith("img_", true)) + } ?: false + if (!hasMediaFile) { invalidDirs.add(it) }