package com.swago.user.adapter

import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.swago.baseswago.model.mine.RoomBlack
import com.swago.user.R
import de.hdodenhof.circleimageview.CircleImageView

/**
 *@date 2022/2/9 09:45
 *description:
 */
class RoomBlackAdapter : BaseQuickAdapter<RoomBlack,BaseViewHolder>(R.layout.item_room_black, arrayListOf()) {

    override fun convert(helper: BaseViewHolder, item: RoomBlack) {
        helper.apply {
            setText(R.id.tvName,item.black_user_name)
            val ivAvatar = itemView.findViewById<CircleImageView>(R.id.ivAvatar)
            Glide.with(itemView.context).load(item.black_user_head_img_url)
                .placeholder(R.mipmap.default_avatar)
                .error(R.mipmap.default_avatar).centerCrop().into(ivAvatar)
            addOnClickListener(R.id.tvDelete)
        }
    }
}