-
-
Notifications
You must be signed in to change notification settings - Fork 265
Preserve Conversation List position #5049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will always place the last opened conversation at the top when coming back. This is not expected but people expect the exact scroll position as when the chat was opened.
It should be solved with
scrollToPositionWithOffset
which gets the scroll position and the offset from when the chat was opened.
… back pressed Signed-off-by: rapterjet2004 <[email protected]>
6278b2f
to
4792f17
Compare
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/5049-talk.apk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have the feeling this can be solved in a simpler way.
Right now the position is passed to ChatActivity and back to ConversationList. This should not be necessary at all but ConversationList should handle this itself.
For example this does not work when the app just goes to background and coming back.
Also, i guess that findFirstVisibleItemPosition is something that should not be necessary. It will "just" scroll to an item instead to the exact position.
Can you have a look if there are simpler ways to achieve this?
Like just using the scroll position on the recyclerview itself and just using lifecycle methods to save/restore the scroll postion, eg. from the viewmodel..?
Conversation List jumps to position of clicked conversation item when back pressed
ToDO
🖼️ Screenshots
Screen_recording_20250609_124059.webm
🏁 Checklist
/backport to stable-xx.x