Use DiffUtil with thread recyclerview
Also added a progress indicator at the top while fetching older messages
This commit is contained in:
parent
c5034a64d5
commit
d8dadd1f55
11 changed files with 207 additions and 110 deletions
|
|
@ -27,4 +27,21 @@ data class Message(
|
|||
fun isReceivedMessage() = type == Telephony.Sms.MESSAGE_TYPE_INBOX
|
||||
|
||||
fun millis() = date * 1000L
|
||||
|
||||
companion object {
|
||||
fun areItemsTheSame(old: Message, new: Message): Boolean {
|
||||
return old.id == new.id
|
||||
}
|
||||
|
||||
fun areContentsTheSame(old: Message, new: Message): Boolean {
|
||||
return old.body == new.body &&
|
||||
old.type == new.type &&
|
||||
old.threadId == new.threadId &&
|
||||
old.isMMS == new.isMMS &&
|
||||
old.attachment == new.attachment &&
|
||||
old.senderName == new.senderName &&
|
||||
old.senderPhotoUri == new.senderPhotoUri &&
|
||||
old.isScheduled == new.isScheduled
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue