fix scroll position resetting on refresh

This commit is contained in:
Pavel Poley 2022-06-06 16:18:05 +03:00
parent 7e60d25a07
commit 86df932ce8
3 changed files with 6 additions and 2 deletions

View File

@ -227,6 +227,11 @@ class ThreadActivity : SimpleActivity() {
ArrayList()
}
messages.sortBy { it.date }
if (messages.size > MESSAGES_LIMIT) {
messages = ArrayList(messages.takeLast(MESSAGES_LIMIT))
}
setupParticipants()
setupAdapter()

View File

@ -3,7 +3,6 @@ package com.simplemobiletools.smsmessenger.helpers
import android.content.Context
import com.simplemobiletools.commons.helpers.BaseConfig
import com.simplemobiletools.smsmessenger.models.Conversation
import java.util.HashSet
class Config(context: Context) : BaseConfig(context) {
companion object {

View File

@ -1,3 +1,3 @@
package com.simplemobiletools.smsmessenger.models
open class ThreadDateTime(val date: Int, val simID: String) : ThreadItem()
data class ThreadDateTime(val date: Int, val simID: String) : ThreadItem()