package com.tanya.careerguidanceproject

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
//import com.tanya.careerguidanceproject.activities.CourseRecyclerAdapter
//import com.tanya.careerguidanceproject.model.College
//import com.tanya.careerguidanceproject.model.Course
import com.tanya.careerguidanceproject.model.Exam

class ExamRecyclerAdapter (val context : Context, val examInfoList : ArrayList<Exam>) : RecyclerView.Adapter<ExamRecyclerAdapter.DashboardViewHolder> (){
    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): DashboardViewHolder {
        val view = LayoutInflater.from(parent.context).inflate(R.layout.exam_rv_item, parent, false)

        return DashboardViewHolder(view)
    }

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

    override fun onBindViewHolder(holder: DashboardViewHolder, position: Int) {
        val modal = examInfoList[position]
        holder.examName.text = modal.examName
        holder.qualification.text = modal.qualification
        holder.examDetails.text = modal.examDetails

    }
    class DashboardViewHolder(view: View) : RecyclerView.ViewHolder(view){
        val examName : TextView = view.findViewById(R.id.txtExamName)
        val qualification : TextView = view.findViewById(R.id.txtQualification)
        val examDetails : TextView = view.findViewById(R.id.txtExamDetails)

    }
}