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.contact.Contacts
import com.bc_chat.im.R
import com.bc_chat.im.databinding.ItemLayoutForwardContactBinding
import com.zhaohaoting.framework.abs.adapter.AbsRecyclerAdapter
import com.zhaohaoting.framework.utils.glid.GlideUtils


/**
 * author：Created by zhaohaoting on 2019/2/27
 * email：526309416@qq.com
 * desc：
 */
class ForwardContactListAdapter constructor(context: Context) : ModeListAdapter<Contacts, ListModel<Contacts>>(context, ListModel()) {

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

    override fun isEmpty(): Boolean {
        return false
    }

    override fun onBindViewHolderHF(baseViewHolder: AbsRecyclerAdapter.BaseViewHolder<*>, realPosition: Int, contacts: Contacts) {
        val dataBinding = baseViewHolder.dataBinding as ItemLayoutForwardContactBinding
        dataBinding.tvName.text = contacts.remark ?: contacts.nickname
        GlideUtils.loadCircleImage(context, contacts.photo, dataBinding.ivHeader)
    }
}
