package com.zxhl.main.page.adapter

import android.content.Context
import android.util.Log
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.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.bumptech.glide.request.RequestOptions
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseRecyclerAdapter
import com.zxhl.cms.net.model.box.GoodList
import com.zxhl.main.R

class GoodsTopAdapter : BaseRecyclerAdapter<GoodList, GoodsTopAdapter.ViewHolder> {
    private var mContext: Context? = null

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

    override fun onBindViewHolder(holder: ViewHolder, position: Int) {
        var bean = mList[position]
//        Glide.with(mContext!!).load(bean?.mainImage)
//           // .apply(RequestOptions.bitmapTransform(RoundedCorners(30)))
       //     .into(holder?.item_url!!)
    }


    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
        return ViewHolder(
            LayoutInflater.from(AppContext.get())
                .inflate(R.layout.item_goods_top, parent, false)
        )
    }

    class ViewHolder : RecyclerView.ViewHolder {
       // var item_url: ImageView?


        constructor(
            itemView: View
        ) : super(itemView) {
          //  item_url = itemView.findViewById<ImageView>(R.id.id_img_main)

        }
    }


}