package com.yidian.shenghuoquan.bgoods.ui.coupon.adapter

import android.widget.TextView
import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.yidian.shenghuoquan.bgoods.R
import com.yidian.shenghuoquan.bgoods.dto.SubCategory

class CategorySubListAdapter : BaseQuickAdapter<SubCategory, BaseViewHolder>(R.layout.commodity_layout_category_list_item) {

  override fun convert(holder: BaseViewHolder, item: SubCategory) {
    val categoryName = holder.getView<TextView>(R.id.tv_category_name)
    categoryName.text = item.name
    if (item.isSelect) {
      categoryName.setTextColor(ContextCompat.getColor(context, R.color.color_1852F1))
    } else {
      categoryName.setTextColor(ContextCompat.getColor(context, R.color.color_333333))
    }
  }
}
