package com.renrenliao.im.ui.adapter

import android.widget.ImageView
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.renrenliao.im.R
import com.renrenliao.im.bean.UserInfo
import com.renrenliao.im.im.AlarmEntity
import com.renrenliao.im.utils.GlideUtils
import com.renrenliao.im.utils.MDateUtils

/**
 **@ClassName VerificationAdapter
 **@Description
 **@Author gan
 **@Date 2022/6/20 13:43
 **/
class VerificationAdapter:BaseQuickAdapter<AlarmEntity,BaseViewHolder>(R.layout.item_verification) {

    override fun convert(holder: BaseViewHolder, item: AlarmEntity) {

        val tvTitle = holder.getView<TextView>(R.id.tv_title)
        val tvMsg = holder.getView<TextView>(R.id.tv_msg)
        val tvTime = holder.getView<TextView>(R.id.tv_time)
        val ivAvatar = holder.getView<ImageView>(R.id.iv_avatar)

        tvTitle.text = item.name
        tvMsg.text = item.msg
        tvTime.text = item.time?.let { MDateUtils.getTimeStr_auto(it,true) }
        GlideUtils.loadUserImage(ivAvatar,item.getAvatarUrl())
    }
}