package ta1.cis.adapter

import android.os.Parcel
import android.os.Parcelable
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import androidx.lifecycle.Lifecycle
import androidx.viewpager2.adapter.FragmentStateAdapter
import ta1.cis.fragment.MateriFragment
import ta1.cis.fragment.PraktikumFragment

class MateriVPAdapter(var fm: FragmentManager,var lifecycle: Lifecycle) : FragmentStateAdapter(fm,lifecycle) {
    override fun getItemCount(): Int = 2

    override fun createFragment(position: Int): Fragment {
        return when(position){
            0 -> {
                MateriFragment()
            }
            1-> {
                PraktikumFragment()
            }
            else -> {
                Fragment()
            }
        }
    }
}