package com.dlc.eboard.adapter

import android.content.Context
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.dlc.eboard.R
import com.rc.httpcore.vo.ByNameBean

class BlankAdapter(private val ct: Context) :
    BaseQuickAdapter<ByNameBean, BaseViewHolder>(R.layout.item_blank_view) {

    override fun convert(holder: BaseViewHolder, item: ByNameBean) {
        holder.setText(R.id.gasName, "气体名称:${item.gasName}")
        holder.setText(R.id.tvSize, "规格:${item.size}Mpa")
        val view = holder.getView<TextView>(R.id.tvLocati)
        if (item.locationState != null && item.locationState.equals("0")) {
            view.text = "离位"
            view.setTextColor(ContextCompat.getColor(ct, R.color.text_color_E00000))
        } else {
            view.text = "在位"
            view.setTextColor(ContextCompat.getColor(ct, R.color.text_color_01B701))
        }
        holder.setText(R.id.beaconTag, item.beaconTag)
    }

}