package com.renrenliao.im.ui.adapter.diff

import androidx.recyclerview.widget.DiffUtil
import com.renrenliao.im.im.AlarmEntity

/**
 **@ClassName AlarmDiffCallBack
 **@Description
 **@Author gan
 **@Date 2022/6/18 11:45
 **/
class AlarmDiffCallback: DiffUtil.ItemCallback<AlarmEntity>(){

    override fun areItemsTheSame(oldItem: AlarmEntity, newItem: AlarmEntity): Boolean {
        return (oldItem.account_uid==newItem.account_uid)
                &&(oldItem.gId==newItem.gId)
                &&(oldItem.msgType==newItem.msgType)
    }

    override fun areContentsTheSame(oldItem: AlarmEntity, newItem: AlarmEntity): Boolean {
        return (oldItem.num == newItem.num)
                &&(oldItem.isTop == newItem.isTop)
                &&(oldItem.msgType == newItem.msgType)
    }
}