package com.zj365.dc.adapter.shop

import android.graphics.Color
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.xty.network.model.ShopCategoryBean
import com.zj365.dc.R

class ShopChildCategoryAdapter : BaseAdapter<ShopCategoryBean>(R.layout.item_category_child) {
    override fun convert(holder: BaseViewHolder, item: ShopCategoryBean) {
        holder.setText(R.id.tv_child_category,item.categoryName)
        if (item.isChecked){
            holder.setTextColor(R.id.tv_child_category,context.getColor(R.color.col_02c))
            holder.setBackgroundColor(R.id.tv_child_category, Color.parseColor("#2102C191"))
        }else{
            holder.setTextColor(R.id.tv_child_category,context.getColor(R.color.col_313))
            holder.setBackgroundColor(R.id.tv_child_category,context.getColor(R.color.white))

        }
    }
}