package com.swago.room.gift.audio

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

class MaiUserAdapter : BaseQuickAdapter<MaiUserInfo, BaseViewHolder>(R.layout.item_mai_user, arrayListOf()) {

    override fun convert(helper: BaseViewHolder?, item: MaiUserInfo?) {
        helper?.apply {
            item?.let {
                itemView.findViewById<CircleImageView>(R.id.ivAvatar).loadUrl(mContext,it.user_head_img_url)
                val view = itemView.findViewById<View>(R.id.view)
                if (it.selected){
                    view.visibility = View.VISIBLE
                }else{
                    view.visibility = View.GONE
                }
            }
        }
    }

}