scroll to the message containing the searched string

This commit is contained in:
tibbi 2021-02-16 12:48:52 +01:00
parent 2990f3be6e
commit d6fdbc4271
3 changed files with 12 additions and 0 deletions

View file

@ -88,6 +88,15 @@ class ThreadActivity : SimpleActivity() {
if (it) {
setupButtons()
setupCachedMessages {
val searchedMessageId = intent.getLongExtra(SEARCHED_MESSAGE_ID, -1L)
intent.removeExtra(SEARCHED_MESSAGE_ID)
if (searchedMessageId != -1L) {
val index = threadItems.indexOfFirst { (it as? Message)?.id == searchedMessageId }
if (index != -1) {
thread_messages_list.smoothScrollToPosition(index)
}
}
setupThread()
}
} else {