package com.datarecovery.master.module.filerecover;

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

import com.datarecovery.master.module.filerecover.fragment.FileRecoverFragment;

public class FileRecoverPageAdapter extends FragmentStateAdapter {

    private final int[] pageList;


    public FileRecoverPageAdapter(@NonNull FragmentActivity fragmentActivity, @NonNull int[] pageList) {
        super(fragmentActivity);
        this.pageList = pageList;
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        return FileRecoverFragment.newInstance(pageList[position]);
    }

    @Override
    public int getItemCount() {
        return pageList.length;
    }
}
