package com.app.simplitend.welcome.welcomecg;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import com.app.simplitend.welcome.welcomecg.fragments.onboardfragemts.OnBoardOneFragment;
import com.app.simplitend.welcome.welcomecg.fragments.onboardfragemts.OnBoardThreeFragment;
import com.app.simplitend.welcome.welcomecg.fragments.onboardfragemts.OnBoardTwoFragment;

public class CgOnBoardAdapter extends FragmentStateAdapter {

    public CgOnBoardAdapter(@NonNull FragmentActivity fragmentActivity) {
        super(fragmentActivity);
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        switch (position){
            case 2:
                return new OnBoardThreeFragment();
            case 1:
                return new OnBoardTwoFragment();
            default:
                return new OnBoardOneFragment();
        }
    }

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