Retain scroll position when deleting messages
Removed the call to `refreshMessages()` as it's not really needed here and also because it'll reset the scroll position in some cases
This commit is contained in:
parent
c6d453f5ab
commit
398c2237bc
2 changed files with 5 additions and 3 deletions
|
|
@ -230,7 +230,9 @@ class ThreadAdapter(
|
|||
fun updateMessages(newMessages: ArrayList<ThreadItem>, scrollPosition: Int = newMessages.lastIndex) {
|
||||
val latestMessages = newMessages.toMutableList()
|
||||
submitList(latestMessages) {
|
||||
recyclerView.scrollToPosition(scrollPosition)
|
||||
if (scrollPosition != -1) {
|
||||
recyclerView.scrollToPosition(scrollPosition)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue