From 3bdca116988fa5ed5c759d45bf9c7ce8fc3f7627 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 1 Oct 2019 10:41:51 +0200 Subject: [PATCH] show portrait folders in some cases --- app/build.gradle | 2 +- .../gallery/pro/activities/MainActivity.kt | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) 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) }