package com.swago.home.innerhome

import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.swago.baseswago.model.Label
import com.swago.home.R

class LabelAdapter: BaseQuickAdapter<Label,BaseViewHolder>(R.layout.item_label, arrayListOf()) {

    override fun convert(helper: BaseViewHolder?, item: Label?) {
        helper?.apply {
            item?.let {
                setText(R.id.tvTitle,it.value)
                if(item.isSelected){
                    setTextColor(R.id.tvTitle,ContextCompat.getColor(itemView.context,R.color.startColor))
                    setBackgroundRes(R.id.tvTitle,R.drawable.shape_ff56b7_16)
                }else{
                    setTextColor(R.id.tvTitle,ContextCompat.getColor(itemView.context,R.color._828C9D))
                    setBackgroundRes(R.id.tvTitle,R.drawable.shape_6000000_16)
                }
            }
        }
    }
}