package com.abbidot.tracker.diff

import androidx.recyclerview.widget.DiffUtil
import com.abbidot.tracker.bean.MessageBean

/**
 *Created  by .yzq on 2021/12/31/031.
 * @link
 * @description:通知消息diffutil,多布局的没有写继承封装
 */
class NotificationsDiffUtil : DiffUtil.ItemCallback<MessageBean>() {
    override fun areItemsTheSame(oldItem: MessageBean, newItem: MessageBean): Boolean {
        return oldItem.messageId == newItem.messageId
    }

    override fun areContentsTheSame(oldItem: MessageBean, newItem: MessageBean): Boolean {
        return oldItem.title == newItem.title && oldItem.message == newItem.message && oldItem.isContainImg == newItem.isContainImg && oldItem.isSelect == newItem.isSelect
    }
}