fixing some folder UI glitches

This commit is contained in:
tibbi 2020-11-02 13:35:14 +01:00
parent 46002b4358
commit e9a878454c
2 changed files with 6 additions and 2 deletions

View File

@ -669,7 +669,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
private fun calculateContentHeight(directories: ArrayList<Directory>) {
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)

View File

@ -675,7 +675,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
dir_check.background?.applyColorFilter(primaryColor)
}
if (scrollHorizontally) {
if (scrollHorizontally && !isListViewType) {
(dir_name.layoutParams as RelativeLayout.LayoutParams).removeRule(RelativeLayout.BELOW)
(dir_thumbnail.layoutParams as RelativeLayout.LayoutParams).addRule(RelativeLayout.ABOVE, dir_name.id)
}