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.CareerRecyclerAdapter
//import com.tanya.careerguidanceproject.CollegeRecyclerAdapter
import com.tanya.careerguidanceproject.R
import com.tanya.careerguidanceproject.model.Career
//import com.tanya.careerguidanceproject.model.College

class CareerList : AppCompatActivity() {

    private lateinit var recyclerDashboard : RecyclerView
    private lateinit var recyclerAdapter : CareerRecyclerAdapter

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

        val careerInfoList = arrayListOf(
            Career("CAT","Post Graduation","https://iimcat.ac.in/per/g01/pub/756/ASM/WebPortal/1/index.html?756@@1@@1"),
            Career("MAT","Post Graduation","https://mat.aima.in/may21/?/feb21/"),
            Career("GMAT","Post Graduation","mba.com/exams/gmat"),
            Career("CPT","Post Graduation","https://www.icai.org/"),
            Career("GATE","Post Graduation","http://gate.iitd.ac.in/"),
            Career("IIT JAM","Post Graduation","https://jam.iisc.ac.in/"),
            Career("CLAT","Post Graduation","https://consortiumofnlus.ac.in/"),
            Career("UPSC","Post Graduation","https://www.upsc.gov.in/"),
            Career("RAS","Post Graduation","https://rpsc.rajasthan.gov.in/"),
        )

        recyclerDashboard = findViewById(R.id.career_list_view)

        // on below line passing our array lost to our adapter class.
        recyclerAdapter = CareerRecyclerAdapter(this@CareerList, careerInfoList)
        recyclerDashboard = findViewById(R.id.career_list_view)

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

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

    }
}