package com.zxhl.cms.pay.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.zxhl.cms.R
import com.zxhl.cms.common.base.BaseRecyclerAdapter
import com.zxhl.cms.net.model.chat.RecordEntity

/**
 * @author (wangXuewei)
 * @datetime 2022-04-12 19:04 GMT+8
 * @detail :
 */
class BecomeVipBannerAdapter :
    BaseRecyclerAdapter<RecordEntity, BecomeVipBannerAdapter.ViewHolder> {
    private var mContext: Context? = null
    private var bannerImg = listOf(
        R.drawable.vip_banner_bj_video,
        R.drawable.vip_banner_bj_vip,
        R.drawable.vip_banner_bj_view,
        R.drawable.vip_banner_bj_chat,
    )
    private var bannerDesc = listOf(
        "Video chat with friends",
        "Exclusive VIP flag",
        "View the album for free",
        "Free text chat"
    )

    constructor(
        content: Context?
    ) : super() {
        mContext = content
    }

    override fun onCreateViewHolder(holder: ViewGroup, p1: Int): BecomeVipBannerAdapter.ViewHolder {
        return ViewHolder(
            LayoutInflater.from(holder.context)
                .inflate(R.layout.item_layout_become_vip_banner_view, holder, false)
        )
    }

    override fun onBindViewHolder(holder: BecomeVipBannerAdapter.ViewHolder, position: Int) {
//        val data = mList[position]
        holder.id_banner_img.setImageResource(bannerImg[position])
        holder.id_banner_desc.text = bannerDesc[position]
    }

    override fun getItemCount(): Int {
        return bannerImg.size
    }

    inner class ViewHolder : RecyclerView.ViewHolder {


        var id_banner_img: ImageView
        var id_banner_desc: TextView

        constructor(itemView: View) : super(itemView) {
            id_banner_img = itemView.findViewById(R.id.id_item_banner_img)
            id_banner_desc = itemView.findViewById(R.id.id_item_banner_desc)
        }
    }

}