package com.tanya.careerguidanceproject.activities

//import android.content.Context
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
//import android.widget.ArrayAdapter
//import android.widget.ListView
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.tanya.careerguidanceproject.R
import com.tanya.careerguidanceproject.model.Course

class CourseList : AppCompatActivity() {

    private lateinit var recyclerDashboard : RecyclerView
    private lateinit var recyclerAdapter : CourseRecyclerAdapter

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

        val courseInfoList = arrayListOf(
            Course("B.tech","4","Science","Engineering"),
            Course("B.com","4","Science","Engineering"),
            Course("B.ed","4","Science","Engineering"),
            Course("B.com honours","4","Science","Engineering"),
            Course("Bsc","4","Science","Engineering"),
            Course("M.tech","4","Science","Engineering"),
            Course("M.com","4","Science","Engineering"),
            Course("LLB","4","Science","Engineering"),
            Course("MBBS","4","Science","Engineering"),
            Course("BAMS","4","Science","Engineering")
        )

        recyclerDashboard = findViewById(R.id.course_list_view)

        // on below line passing our array lost to our adapter class.
        recyclerAdapter = CourseRecyclerAdapter(this@CourseList, courseInfoList)
        recyclerDashboard = findViewById(R.id.course_list_view)

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

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


    }
}