package com.zj365.health.adapter

import android.widget.TextView
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.zj365.health.R

class TimesAdapter(var times:MutableMap<String,String>,var current:Int=-1):BaseAdapter<String>(R.layout.item_time_dialog) {
    override fun convert(holder: BaseViewHolder, item: String) {
        holder.setText(R.id.mStatus,item)
         if(times.containsKey("$item:00")){
            holder.itemView.isEnabled=false
            holder.setTextColorRes(R.id.mStatus,R.color.col_bfc)
                .setBackgroundResource(R.id.mStatus,R.drawable.shape_not_change)
        }else{

            holder.itemView.isEnabled=true

             if(holder.layoutPosition==current){
                 holder.setTextColorRes(R.id.mStatus,R.color.white)
                     .setBackgroundResource(R.id.mStatus,R.drawable.shape_un_click)
             }else{
                 holder.setTextColorRes(R.id.mStatus,R.color.col_455)
                     .setBackgroundResource(R.id.mStatus,R.drawable.shape_un_sel_green_bg)
             }


        }

    }
}