package com.example.applock.lockadapter;

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

import com.example.applock.fragment.LockedFragment;
import com.example.applock.fragment.SystemFragment;
import com.example.applock.fragment.ThirdFragment;

public class FragmentAdapter extends FragmentStateAdapter {
    public FragmentAdapter(@NonNull FragmentActivity fragmentActivity) {
        super(fragmentActivity);
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        switch (position) {
            case 0:
                return SystemFragment.newInstance(true);
            case 1:
                return SystemFragment.newInstance(false);
            default:
                return new LockedFragment();
        }
    }

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