package com.player.musicoo.view

import android.annotation.SuppressLint
import android.content.Context
import android.widget.TextView
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.player.musicoo.App
import com.player.musicoo.R
import com.player.musicoo.adapter.ResponsiveListAdapter
import com.player.musicoo.adapter.SoundsOfNatureAdapter
import com.player.musicoo.innertube.Innertube
import com.player.musicoo.util.GridSpacingItemDecoration

@SuppressLint("ViewConstructor")
class MusicResponsiveListView(context: Context, 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 = ResponsiveListAdapter(context, homePage.contents)
        rv?.layoutManager = GridLayoutManager(context, 3, GridLayoutManager.HORIZONTAL, false)
        rv?.adapter = adapter
    }

}