package com.swago.room.pk

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.swago.baseswago.model.live.pk.PKSeat
import com.swago.loadUrl
import com.swago.room.R
import de.hdodenhof.circleimageview.CircleImageView

class PKAudienceAdapter : BaseQuickAdapter<PKSeat,BaseViewHolder>(R.layout.item_pk_seat, arrayListOf()) {

    override fun convert(helper: BaseViewHolder?, item: PKSeat?) {
        helper?.apply {
            item?.let {
                itemView.findViewById<CircleImageView>(R.id.ivAvatar).loadUrl(itemView.context,it.userAvatar)
                when(layoutPosition){
                    0 -> {
                        setImageResource(R.id.ivPosition,R.mipmap.first)
                    }
                    1 -> {
                        setImageResource(R.id.ivPosition,R.mipmap.second)
                    }

                    2 -> {
                        setImageResource(R.id.ivPosition,R.mipmap.third)
                    }
                }
            }
        }
    }
}