package com.develop.step.details

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.develop.food.base.utils.isNightTheme
import com.develop.food.base.widgets.MarqueeTextView
import com.develop.step.R

class CookDetailSourceAdapter: BaseQuickAdapter<CookSourceItem, BaseViewHolder>(
    R.layout.item_cook_source
) {

    var colorResId = R.color.color_fff
    override fun convert(holder: BaseViewHolder, item: CookSourceItem) {
        if (isNightTheme()){
            holder.getView<MarqueeTextView>(R.id.tv_source_name).setTextColor(context.resources.getColor(colorResId))
            holder.getView<TextView>(R.id.tv_source_amount).setTextColor(context.resources.getColor(colorResId))
        }
        holder.setText(R.id.tv_source_name, item.name)
        holder.setText(R.id.tv_source_amount, item.amount)
    }
}