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 ec856d540..d15485d13 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 @@ -669,7 +669,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { private fun calculateContentHeight(directories: ArrayList) { val layoutManager = directories_grid.layoutManager as MyGridLayoutManager - val thumbnailHeight = (layoutManager.getChildAt(0)?.height ?: 0) + resources.getDimension(R.dimen.medium_margin).toInt() * 2 + var thumbnailHeight = (layoutManager.getChildAt(0)?.height ?: 0) + if (config.viewTypeFolders == VIEW_TYPE_GRID) { + thumbnailHeight += resources.getDimension(R.dimen.medium_margin).toInt() * 2 + } + val rowCount = (directories.size - 1) / layoutManager.spanCount + 1 val fullHeight = rowCount * thumbnailHeight directories_vertical_fastscroller.setContentHeight(fullHeight) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt index 59ffad8ba..5fadd61c9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt @@ -675,7 +675,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList