mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 13:08:00 +01:00
recalculate fastscroller position at measuring content
This commit is contained in:
parent
8e4aa5b438
commit
185e4dcb6c
1 changed files with 6 additions and 3 deletions
|
@ -614,6 +614,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
||||||
|
|
||||||
fullHeight += ((curSectionItems - 1) / layoutManager.spanCount + 1) * mThumbnailHeight
|
fullHeight += ((curSectionItems - 1) / layoutManager.spanCount + 1) * mThumbnailHeight
|
||||||
media_vertical_fastscroller.setContentHeight(fullHeight)
|
media_vertical_fastscroller.setContentHeight(fullHeight)
|
||||||
|
media_vertical_fastscroller.setScrollTo(media_grid.computeVerticalScrollOffset())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -650,13 +651,15 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
||||||
|
|
||||||
private fun increaseColumnCount() {
|
private fun increaseColumnCount() {
|
||||||
config.mediaColumnCnt = ++(media_grid.layoutManager as MyGridLayoutManager).spanCount
|
config.mediaColumnCnt = ++(media_grid.layoutManager as MyGridLayoutManager).spanCount
|
||||||
invalidateOptionsMenu()
|
columnCountChanged()
|
||||||
media_grid.adapter?.notifyDataSetChanged()
|
|
||||||
measureRecyclerViewContent(mMedia)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun reduceColumnCount() {
|
private fun reduceColumnCount() {
|
||||||
config.mediaColumnCnt = --(media_grid.layoutManager as MyGridLayoutManager).spanCount
|
config.mediaColumnCnt = --(media_grid.layoutManager as MyGridLayoutManager).spanCount
|
||||||
|
columnCountChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun columnCountChanged() {
|
||||||
invalidateOptionsMenu()
|
invalidateOptionsMenu()
|
||||||
media_grid.adapter?.notifyDataSetChanged()
|
media_grid.adapter?.notifyDataSetChanged()
|
||||||
measureRecyclerViewContent(mMedia)
|
measureRecyclerViewContent(mMedia)
|
||||||
|
|
Loading…
Reference in a new issue