package xn.hxp.ui.adapter

import android.content.Context
import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import xn.hxp.R
import com.rc.httpcore.bean.RuleBean

//领用-选择要打开的柜门
class CabinetDoorAdapter(private val ct: Context) :
    BaseQuickAdapter<RuleBean, BaseViewHolder>(R.layout.item_cabinet_door) {

    override fun convert(holder: BaseViewHolder, item: RuleBean) {

        if (item.isType) {
            holder.setTextColor(R.id.cont, ContextCompat.getColor(ct, R.color.white))
            holder.setBackgroundResource(R.id.cont, R.color.purple_ff54a2ea)
            holder.setText(R.id.cont, "${item.cabinetName}")
        } else {
            holder.setTextColor(R.id.cont, ContextCompat.getColor(ct, R.color.black))
            holder.setBackgroundResource(R.id.cont, R.color.white)
            holder.setText(R.id.cont, "${item.cabinetName}")
        }

    }
}