class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        val recyclerView: RecyclerView = findViewById(R.id.rcView)
        val adapter = Adapter(fetchData(fetchData(item))
        recyclerView.layoutManager = GridLayoutManager(this, 2)
        recyclerView.adapter=adapter
    }

    private fun fetchData(): MutableList<Int> {
        val item = mutableListOf<Int>()
        item.add(com.google.android.material.R.drawable.ic_clock_black_24dp)
        item.add(com.google.android.material.R.drawable.ic_clock_black_24dp)
        item.add(com.google.android.material.R.drawable.ic_clock_black_24dp)
        item.add(com.google.android.material.R.drawable.ic_clock_black_24dp)
        item.add(com.google.android.material.R.drawable.ic_clock_black_24dp)
        item.add(com.google.android.material.R.drawable.ic_clock_black_24dp)
        item.add(com.google.android.material.R.drawable.ic_clock_black_24dp)
        item.add(com.google.android.material.R.drawable.ic_clock_black_24dp)
        return item
    }
}