package com.abbidot.tracker.diff

import com.abbidot.tracker.base.BaseDiffCallBack
import com.abbidot.tracker.bean.MenuTxtBean

/**
 *Created  by .yzq on 2022/3/11/011.
 * @link
 * @description:宠物属性数据比较
 */
class PetPropertyDiffCallBack(oldList: MutableList<MenuTxtBean>,
                              newList: MutableList<MenuTxtBean>) :
    BaseDiffCallBack<MenuTxtBean>(oldList, newList) {
    private var mOldList = oldList
    private val mNewList = newList
    override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
        return mOldList[oldItemPosition].imageId == mNewList[newItemPosition].imageId
    }

    override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
        return mOldList[oldItemPosition].menuName == mNewList[newItemPosition].menuName&&
                mOldList[oldItemPosition].menuValue==mNewList[newItemPosition].menuValue
    }
}