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,10 +1028,13 @@ 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
val clickedDir = it as Directory
if (clickedDir.subfoldersCount == 1 || !config.groupDirectSubfolders) {
val path = clickedDir.path
if (path != config.tempFolderPath) {
itemClicked(path)
}
}
}.apply {
setupZoomListener(mZoomListener)
directories_grid.adapter = this