mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Fix: Prevent RecyclerView from resetting scroll position after returning from preview (#5873) (#5880)
Resolved an issue where RecyclerView would incorrectly scroll to the top after exiting fullscreen preview. Adjusted scroll behavior to maintain position unless actioned images are filtered. Implemented observer logic adjustments to handle dataset updates more efficiently. Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
This commit is contained in:
parent
014feb54e5
commit
7b0b604834
1 changed files with 5 additions and 3 deletions
|
|
@ -285,9 +285,11 @@ class ImageFragment :
|
|||
imageAdapter.notifyDataSetChanged()
|
||||
selectorRV?.let {
|
||||
it.visibility = View.VISIBLE
|
||||
lastItemId?.let { pos ->
|
||||
(it.layoutManager as GridLayoutManager)
|
||||
.scrollToPosition(ImageHelper.getIndexFromId(filteredImages, pos))
|
||||
if (switch?.isChecked == false) {
|
||||
lastItemId?.let { pos ->
|
||||
(it.layoutManager as GridLayoutManager)
|
||||
.scrollToPosition(ImageHelper.getIndexFromId(filteredImages, pos))
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue