SES-789 - Scroll to bottom of long new message(s) (#1426)

* WIP

* Working - push before cleanup

* Fixes #1316

* Cleanup

* PR review adjustments

* Fixed scrolling when receiving an image based message while keyboard is up

* Prevent auto-scroll to last seen item pos in conversation view if <= 3

* Put back <=3 check to scroll

* Forced scrolling to bottom of long messages (both sent and received) when already at the bottom of the RecyclerView

* Fixes #1364

---------

Co-authored-by: = <=>
Co-authored-by: AL-Session <160798022+AL-Session@users.noreply.github.com>
This commit is contained in:
Al Lansley 2024-03-27 07:21:21 +11:00 committed by GitHub
parent 84a399af06
commit 9e62e1eab4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2162,7 +2162,10 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
override fun onChanged() { override fun onChanged() {
super.onChanged() super.onChanged()
if (recyclerView.isScrolledToWithin30dpOfBottom) { if (recyclerView.isScrolledToWithin30dpOfBottom) {
recyclerView.scrollToPosition(adapter.itemCount-1) // Note: The adapter itemCount is zero based - so calling this with the itemCount in
// a non-zero based manner scrolls us to the bottom of the last message (including
// to the bottom of long messages as required by Jira SES-789 / GitHub 1364).
recyclerView.scrollToPosition(adapter.itemCount)
} }
} }
} }