package com.zj365.health.adapter

import androidx.cardview.widget.CardView
import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.zj365.health.R

class XdAnswerAdapter(var status:Int=-1):BaseAdapter<String>(R.layout.item_answer_xd) {
    override fun convert(holder: BaseViewHolder, item: String) {

        if(status==holder.layoutPosition){
            holder.setText(R.id.mTitle,item).setTextColorRes(R.id.mTitle,R.color.white)
            holder.getView<CardView>(R.id.mCard).setCardBackgroundColor(ContextCompat.getColor(context,R.color.col_e03))
        }else{
            holder.setText(R.id.mTitle,item).setTextColorRes(R.id.mTitle,R.color.col_455)
            holder.getView<CardView>(R.id.mCard).setCardBackgroundColor(ContextCompat.getColor(context,R.color.col_e9e))
        }





    }
}