Merge pull request #358 from pavelpoley/fix/scroll-position-reseting

Fix scroll position resetting on refresh
This commit is contained in:
Tibor Kaputa 2022-06-06 19:17:09 +02:00 committed by GitHub
commit 88f47ae10b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

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

View File

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

View File

@ -1,3 +1,3 @@
package com.simplemobiletools.smsmessenger.models 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()