package ta1.cis.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
import androidx.viewpager2.adapter.FragmentStateAdapter
import ta1.cis.fragment.tabitem.*

class ViewPagerAdapter(fragmentManager: FragmentManager, lifecycle: Lifecycle): FragmentStateAdapter(fragmentManager, lifecycle) {
    override fun getItemCount(): Int {
        return 7
    }

    override fun createFragment(position: Int): Fragment {
      return  when(position){
            0->{
                D_AkademisFragment()
            }
            1->{
                D_PribadiFragment()
            }
            2->{
                D_OrangTuaFragment()
            }
            3->{
                D_AsalSekolahFragment()
            }
            4->{
                D_AsramaFragment()
            }
            5->{
                D_NilaiPerilakuFragment()
            }
            6->{
                H_StudiFragment()
            }
            else->{
                Fragment()
            }
        }
    }
}