package com.swago.room.adapter

import android.view.View
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.swago.baseswago.cusview.SwagoLevelView
import com.swago.baseswago.model.live.RoomUserModel
import com.swago.loadUrl
import com.swago.room.R
import de.hdodenhof.circleimageview.CircleImageView

/**
 *@date 2022/3/29 20:33
 *description:
 */
class AudienceAdapter : BaseQuickAdapter<RoomUserModel.ListBean, BaseViewHolder>(R.layout.item_dialog_audience, arrayListOf()) {
    override fun convert(helper: BaseViewHolder, item: RoomUserModel.ListBean) {
        helper.apply {
            itemView.findViewById<CircleImageView>(R.id.ivAvatar).loadUrl(mContext,item.user_head_img_url)
            setText(R.id.tvName,item.user_name)
            setGone(R.id.ivBenefit,item.is_benefit == 1)
            setGone(R.id.tvAgent,item.is_service == 1)
            setGone(R.id.tvOfficial,item.is_official == 1)
            setGone(R.id.ivCrown,item.is_crown == 1)
            setGone(R.id.ivCup,item.is_cup == 1)
            itemView.findViewById<SwagoLevelView>(R.id.tvLevel).setUserLevel(item.user_wealth_level)
        }
    }
}