open the clicked directory only if it contains no subfolders, or grouping is disabled

This commit is contained in:
tibbi 2018-12-14 22:51:28 +01:00
parent 1e47a6dd2f
commit 5482059235

View file

@ -1028,9 +1028,12 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
initZoomListener() initZoomListener()
val fastscroller = if (config.scrollHorizontally) directories_horizontal_fastscroller else directories_vertical_fastscroller val fastscroller = if (config.scrollHorizontally) directories_horizontal_fastscroller else directories_vertical_fastscroller
DirectoryAdapter(this, dirsToShow, this, directories_grid, isPickIntent(intent) || isGetAnyContentIntent(intent), fastscroller) { DirectoryAdapter(this, dirsToShow, this, directories_grid, isPickIntent(intent) || isGetAnyContentIntent(intent), fastscroller) {
val path = (it as Directory).path val clickedDir = it as Directory
if (path != config.tempFolderPath) { if (clickedDir.subfoldersCount == 1 || !config.groupDirectSubfolders) {
itemClicked(path) val path = clickedDir.path
if (path != config.tempFolderPath) {
itemClicked(path)
}
} }
}.apply { }.apply {
setupZoomListener(mZoomListener) setupZoomListener(mZoomListener)