From 5482059235c0e8381070ef1a6d47f7170f678048 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 14 Dec 2018 22:51:28 +0100 Subject: [PATCH] open the clicked directory only if it contains no subfolders, or grouping is disabled --- .../gallery/pro/activities/MainActivity.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 33cc426fe..651576201 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 @@ -1028,9 +1028,12 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { initZoomListener() val fastscroller = if (config.scrollHorizontally) directories_horizontal_fastscroller else directories_vertical_fastscroller DirectoryAdapter(this, dirsToShow, this, directories_grid, isPickIntent(intent) || isGetAnyContentIntent(intent), fastscroller) { - val path = (it as Directory).path - if (path != config.tempFolderPath) { - itemClicked(path) + val clickedDir = it as Directory + if (clickedDir.subfoldersCount == 1 || !config.groupDirectSubfolders) { + val path = clickedDir.path + if (path != config.tempFolderPath) { + itemClicked(path) + } } }.apply { setupZoomListener(mZoomListener)