package com.bc_chat.im.adapter

import android.content.Context
import com.bc_chat.bc_base.adapter.ModeListAdapter
import com.bc_chat.bc_base.entity.ListModel
import com.bc_chat.bc_base.entity.group.MemberBean
import com.bc_chat.im.R
import com.bc_chat.im.databinding.ItemUserImageBinding
import com.zhaohaoting.framework.utils.glid.GlideUtils

/**
 * Created by zhaoting on 2019/3/2.
 * Desc：用户头像
 */
class UserImageAdapter(context: Context) : ModeListAdapter<MemberBean, ListModel<MemberBean>>(context, ListModel()) {

    override fun getItemLayoutId(type: Int): Int = R.layout.item_user_image

    override fun onBindViewHolderHF(baseViewHolder: BaseViewHolder<*>?, realPosition: Int, data: MemberBean?) {
        val binding = baseViewHolder?.dataBinding as ItemUserImageBinding
        GlideUtils.loadCircleImage(context, data?.photo, binding.headView)
    }
}
