package com.tanya.careerguidanceproject.activities

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.tanya.careerguidanceproject.CollegeRecyclerAdapter
import com.tanya.careerguidanceproject.R
import com.tanya.careerguidanceproject.model.College
//import com.tanya.careerguidanceproject.model.Course

class CollegeList : AppCompatActivity() {

    private lateinit var recyclerDashboard : RecyclerView
    private lateinit var recyclerAdapter : CollegeRecyclerAdapter

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_college_list)

        val collegeInfoList = arrayListOf(
            College("Banasthali Vidyapith","Jaipur","Engineering College"),
            College("IIS University","Jaipur","EngineeringCollege"),
            College("JBWU","Jaipur","EngineeringCollege"),
            College("Delhi University","Delhi","EngineeringCollege"),
            College("IIT","Bombay","EngineeringCollege"),
            College("MNIT","Jaipur","EngineeringCollege"),
            College("Amity University","Jaipur","EngineeringCollege"),
            College("BITS Pilani","Pilani","EngineeringCollege"),
            College("Invertis University","Bareilly","EngineeringCollege"),
            College("VIT","Vellore","EngineeringCollege"),
        )

        recyclerDashboard = findViewById(R.id.college_list_view)

        // on below line passing our array lost to our adapter class.
        recyclerAdapter = CollegeRecyclerAdapter(this@CollegeList, collegeInfoList)
        recyclerDashboard = findViewById(R.id.college_list_view)

        // setting layout manager for our recycler view.
        val linearLayoutManager =
            LinearLayoutManager(this@CollegeList, RecyclerView.VERTICAL, false)
        recyclerDashboard.layoutManager = linearLayoutManager

        // setting our adapter to recycler view.
        recyclerDashboard.adapter = recyclerAdapter

    }
}