package com.lukouguoji.gjj.holder

import android.view.View
import com.lukouguoji.gjj.databinding.ItemIntImpTallyBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.GjjImportTally

/**
 * 国际进港理货报告 ViewHolder
 */
class IntImpTallyViewHolder(view: View) :
    BaseViewHolder<GjjImportTally, ItemIntImpTallyBinding>(view) {

    override fun onBind(item: Any?, position: Int) {
        val bean = getItemBean(item) ?: return
        binding.bean = bean
        binding.position = position
        binding.executePendingBindings()

        // 选中图标点击 - 切换选择状态
        binding.ivIcon.setOnClickListener {
            bean.checked.set(!bean.checked.get())
            binding.executePendingBindings()
        }
    }
}
