package com.lukouguoji.aerologic.page.message.list

import android.view.View
import com.lukouguoji.aerologic.databinding.ItemMessageListBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.MessageBean

class MessageListViewHolder(view: View) :
    BaseViewHolder<MessageBean, ItemMessageListBinding>(view) {
    override fun onBind(item: Any?, position: Int) {
        val itemBean = getItemBean(item)!!
        binding.bean = itemBean

        binding.ivIcon.setOnClickListener {
            if (itemBean.state == "0") {
                itemBean.checked.set(!itemBean.checked.get())
            }
        }

        notifyItemClick(position, binding.ll)
    }
}