package com.quansu.heifengwuliu.adapter

import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.quansu.heifengwuliu.R
import com.quansu.heifengwuliu.databinding.ItemInvoiceBinding
import com.quansu.heifengwuliu.model.DriverBean
import com.ysnows.base.base.BAdapter

class InvoiceAdapter() : BAdapter<DriverBean, BaseDataBindingHolder<ItemInvoiceBinding>>(R.layout.item_invoice) {
    override fun convert(holder: BaseDataBindingHolder<ItemInvoiceBinding>, item: DriverBean) {
        holder.dataBinding?.item = item

        holder.dataBinding?.imgCheck!!.setOnClickListener {
            if(item.checked==0) item.checked=1 else item.checked=0
            notifyItemChanged(holder.adapterPosition)
        }
    }
}
