package com.seatel.mobilehall.ui.home.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.seatel.mobilehall.R
import com.seatel.mobilehall.ui.base.adapter.BaseAdapter
import kotlinx.android.synthetic.main.support_list_item.view.*

class SupportedDeviceDetailAdapter(
    var context: Context,
    var supportedDeviceDetailList: List<String>
) : BaseAdapter<SupportedDeviceDetailAdapter.SupportListVH>() {

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SupportListVH {
        return SupportListVH(
            LayoutInflater.from(context)
                .inflate(R.layout.supported_device_detail_item, parent, false)
        )
    }

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

    override fun onBindViewHolder(holder: SupportListVH, position: Int) {
        holder.txtDescription.text = supportedDeviceDetailList[position]
    }

    class SupportListVH(view: View) : RecyclerView.ViewHolder(view) {
        val txtDescription = view.text_description

    }
}