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.LinearLayout
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
import com.zxhl.cms.net.model.pay.VipPayEntity
import com.zxhl.cms.utils.OnRecycleItemClickListener

/**
 * @author (wangXuewei)
 * @datetime 2022-04-12 19:04 GMT+8
 * @detail :
 */
class CoinStoreAdapter: BaseRecyclerAdapter<RecordEntity, CoinStoreAdapter.ViewHolder> {
    private var mContext: Context? = null
    private val listener: OnRecycleItemClickListener<RecordEntity>

    constructor(
        content: Context?,
        listener: OnRecycleItemClickListener<RecordEntity>
    ) : super() {
        this.listener = listener
        mContext = content
    }

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

    override fun onBindViewHolder(holder: CoinStoreAdapter.ViewHolder, position: Int) {
//        val data = mList[position]
        holder.id_tv_coin.text="${360}"
        holder.id_tv_money.text="$${4.99}"
        holder.id_ll_item_view.setOnClickListener {
            listener?.onItemClick(it,position,null)
        }
    }

    override fun getItemCount(): Int {
        return 4
    }

    inner class ViewHolder : RecyclerView.ViewHolder {


        var id_ll_item_view: LinearLayout
        var id_tv_coin: TextView
        var id_tv_money: TextView

        constructor(itemView: View) : super(itemView) {
            id_ll_item_view = itemView.findViewById(R.id.id_ll_item_coin_story_view)
            id_tv_coin = itemView.findViewById(R.id.id_tv_coin_num)
            id_tv_money = itemView.findViewById(R.id.id_tv_coin_pay_money)
        }
    }

}