package com.jian11058.mykotlindemo.adapter
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import com.jian11058.mykotlindemo.base.BaseFragment
/**
* author : jian11058
* time : 2021/9/15
* desc :
*/
class FragmentAdapter: FragmentPagerAdapter {
private var fragments:MutableList<BaseFragment>?=null
constructor(fm: FragmentManager, fragments:MutableList<BaseFragment>):super(fm){
this.fragments=fragments
}
override fun getCount(): Int {
return fragments?.size!!
}
override fun getItem(position: Int): Fragment {
return fragments?.get(position)!!
}
}