package com.example.chemical.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 com.example.chemical.R
import com.rc.httpcore.bean.CabinetDoorVo

//右边得柜子
class CabinetDoorRighAdapter(private val ct: Context) :
    BaseQuickAdapter<CabinetDoorVo, BaseViewHolder>(R.layout.item_cabinet_door) {

    override fun convert(holder: BaseViewHolder, item: CabinetDoorVo) {
        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.doorName}")
        }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.doorName}")
        }

    }
}