From e9a878454cd440a298ac929a0907cf96660372b7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 2 Nov 2020 13:35:14 +0100 Subject: [PATCH] fixing some folder UI glitches --- .../gallery/pro/activities/MainActivity.kt | 6 +++++- .../gallery/pro/adapters/DirectoryAdapter.kt | 2 +- 2 files changed, 6 insertions(+), 2 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 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