package net.huansi.app.hssummarizingboard.adapter

import android.content.Context
import baseform.android.huansi.net.baseui.HsRecyclerViewBaseAdapter
import net.huansi.app.hssummarizingboard.R
import net.huansi.app.hssummarizingboard.databinding.ItemBrandBinding
import net.huansi.app.hssummarizingboard.entity.BrandBean

/**
des:
author:zhang
time:2023/10/20 19:02
 */
class BrandAdapter(list: List<BrandBean>, context: Context) :
    HsRecyclerViewBaseAdapter<BrandBean, ItemBrandBinding>(list, context) {


    override fun getLayoutId(): Int {
        return R.layout.item_brand
    }

    override fun onHsBindViewHolder(
        holder: HsRecyclerViewBaseViewHolder<ItemBrandBinding>,
        bean: BrandBean,
        position: Int
    ) {
        holder.binding.tvBrandName.text = bean.brandName
        holder.binding.tvBrandName.setBackgroundColor(
            if (bean.isCheck)
                mContext.resources.getColor(R.color.F4CD6BF)
            else
                mContext.resources.getColor(R.color.F0042AE)
        )
    }
}