package com.develop.setting.adapter

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.recyclerview.widget.RecyclerView
import com.develop.base.ext.load
import com.develop.setting.R
import com.youth.banner.adapter.BannerAdapter

class ScreenBannerAdapter(dataList: MutableList<Int>) :
    BannerAdapter<Int, ScreenBannerAdapter.ViewHolder>(dataList) {
    override fun onCreateHolder(parent: ViewGroup?, viewType: Int): ViewHolder {
        return ViewHolder(
            LayoutInflater.from(parent?.context).inflate(R.layout.item_screen_banner, parent, false)
        )
    }

    class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
        val ivBanner: ImageView = itemView.findViewById(R.id.iv_banner)

    }

    override fun onBindView(
        holder: ViewHolder,
        data: Int,
        position: Int,
        size: Int
    ) {

        holder.ivBanner.load(data)
    }
}