better method: limit the total of sms+mms to MESSAGES_LIMIT
this causes the sms and mms to load together for a smoother flow
This commit is contained in:
parent
7b5d32e624
commit
707d7499e3
2 changed files with 3 additions and 2 deletions
|
|
@ -135,6 +135,7 @@ fun Context.getMessages(
|
|||
.filter { it.participants.isNotEmpty() }
|
||||
.filterNot { it.isScheduled && it.millis() < System.currentTimeMillis() }
|
||||
.sortedWith(compareBy<Message> { it.date }.thenBy { it.id })
|
||||
.takeLast(limit)
|
||||
.toMutableList() as ArrayList<Message>
|
||||
|
||||
return messages
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue