package com.swago.room.hongbao

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.swago.baseswago.model.live.RedReceiveModel
import com.swago.loadUrl
import com.swago.room.R
import de.hdodenhof.circleimageview.CircleImageView

class RedReceivedAdapter :  BaseQuickAdapter<RedReceiveModel, BaseViewHolder>(R.layout.item_red_bag, arrayListOf()) {

    override fun convert(helper: BaseViewHolder?, item: RedReceiveModel?) {
        helper?.apply {
            item?.let {
                itemView.findViewById<CircleImageView>(R.id.ivAvatar).loadUrl(itemView.context,it.user_head_img_url)
                setText(R.id.tvName,it.user_name)
                setText(R.id.tvTime,it.created_at)
                setText(R.id.tvCoin,it.package_coins)
                setVisible(R.id.tvLucky,it.max_user==1)
            }
        }
    }
}