package adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import fragment.ArticleHomeFragment

class ArticlePagerAdapter constructor(activity: FragmentActivity,list: MutableList<ArticleHomeFragment>):FragmentStateAdapter(activity) {

    private var list = mutableListOf<ArticleHomeFragment>()

    init {
        this.list = list
    }

    override fun getItemCount(): Int {
        return list.size
    }

    override fun createFragment(position: Int): Fragment {
        return list[position]
    }


}