fixing some folder UI glitches
This commit is contained in:
parent
46002b4358
commit
e9a878454c
|
@ -669,7 +669,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
|
|
||||||
private fun calculateContentHeight(directories: ArrayList<Directory>) {
|
private fun calculateContentHeight(directories: ArrayList<Directory>) {
|
||||||
val layoutManager = directories_grid.layoutManager as MyGridLayoutManager
|
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 rowCount = (directories.size - 1) / layoutManager.spanCount + 1
|
||||||
val fullHeight = rowCount * thumbnailHeight
|
val fullHeight = rowCount * thumbnailHeight
|
||||||
directories_vertical_fastscroller.setContentHeight(fullHeight)
|
directories_vertical_fastscroller.setContentHeight(fullHeight)
|
||||||
|
|
|
@ -675,7 +675,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
|
||||||
dir_check.background?.applyColorFilter(primaryColor)
|
dir_check.background?.applyColorFilter(primaryColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scrollHorizontally) {
|
if (scrollHorizontally && !isListViewType) {
|
||||||
(dir_name.layoutParams as RelativeLayout.LayoutParams).removeRule(RelativeLayout.BELOW)
|
(dir_name.layoutParams as RelativeLayout.LayoutParams).removeRule(RelativeLayout.BELOW)
|
||||||
(dir_thumbnail.layoutParams as RelativeLayout.LayoutParams).addRule(RelativeLayout.ABOVE, dir_name.id)
|
(dir_thumbnail.layoutParams as RelativeLayout.LayoutParams).addRule(RelativeLayout.ABOVE, dir_name.id)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue