package com.zj365.health.adapter

import android.widget.ImageView
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.xty.common.setRoundImage
import com.zj365.health.R

class UploadPicAdapter  : BaseAdapter<String>(R.layout.item_picture) {
    override fun convert(holder: BaseViewHolder, item: String) {
        holder.setGone(R.id.tvNumb,true)
        if (item.isEmpty()){
            holder.itemView.findViewById<ImageView>(R.id.ivImage).setImageResource(R.mipmap.changctup)
            holder.setGone(R.id.ivDelete,true)

        } else {
            holder.setGone(R.id.ivDelete,false)
            holder.getView<ImageView>(R.id.ivImage)
                .apply {
                    setRoundImage(context, item)
                }
        }
    }
}