package com.player.musicoo.view

import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.widget.TextView
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.player.musicoo.R
import com.player.musicoo.adapter.ResponsiveListAdapter
import com.player.musicoo.adapter.TowRowListAdapter
import com.player.musicoo.innertube.Innertube

@SuppressLint("ViewConstructor")
class MusicTowRowListView(context: Activity, homePage: Innertube.HomePage) : ModuleView(context) {
    init {
        contentView = inflate(getContext(), R.layout.music_list_layout, this)
        val title = contentView?.findViewById<TextView>(R.id.title)
        title?.text = homePage.title

        val rv = contentView?.findViewById<RecyclerView>(R.id.rv)

        val adapter = TowRowListAdapter(context, homePage.contents)
        rv?.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
        rv?.adapter = adapter
    }

}