package com.app.simplitend.welcome.welcomepatient.fragments;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.Lifecycle;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import com.app.simplitend.welcome.welcomepatient.fragments.onboardfragments.OnBoardOne;
import com.app.simplitend.welcome.welcomepatient.fragments.onboardfragments.OnBoardThree;
import com.app.simplitend.welcome.welcomepatient.fragments.onboardfragments.OnBoardTwo;

public class OnBoardPagerAdapter extends FragmentStateAdapter {

    public OnBoardPagerAdapter(@NonNull FragmentManager fragmentManager, @NonNull Lifecycle lifecycle) {
        super(fragmentManager, lifecycle);
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        switch (position){
            case 2:
                return new OnBoardThree();
            case 1:
                return new OnBoardTwo();
            default:
                return new OnBoardOne();
        }
    }

    @Override
    public int getItemCount() {
        return 3;
    }

}
