diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt index 9c43960f..2959d69d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt @@ -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() diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Config.kt index edca4fef..77550a12 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/Config.kt @@ -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 { diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/models/ThreadDateTime.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/models/ThreadDateTime.kt index d69d81fa..aae15f0f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/models/ThreadDateTime.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/models/ThreadDateTime.kt @@ -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()