package com.cheng.blzb.ui.fragment.guide.adapter

import android.graphics.Color
import android.graphics.Typeface
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.cheng.blzb.R
import com.cheng.blzb.bean.AreaEntity
import com.example.base.extensions.getColor

class GuideItem2Area1Adapter: BaseQuickAdapter<AreaEntity, BaseViewHolder>(R.layout.listitem_guide_area1) {
    override fun convert(holder: BaseViewHolder, item: AreaEntity) {
        holder.setText(R.id.tv_name, item.name)
        holder.setTextColor(R.id.tv_name, if (item.isChecked) getColor(R.color.color_125ffe) else getColor(R.color.color_222222))
        holder.getView<TextView>(R.id.tv_name).typeface = if (item.isChecked) Typeface.DEFAULT_BOLD else Typeface.DEFAULT
        holder.itemView.setBackgroundColor(if (item.isChecked) Color.WHITE else Color.TRANSPARENT)
    }
}