package ch.spherIC.recurvebowsight.ui.calcsight;

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

public class CalculateSightCollectionAdapter extends FragmentStateAdapter {

    private final int itemsCount;

    public CalculateSightCollectionAdapter(Fragment fragment, int itemsCount) {
        super(fragment);
        this.itemsCount = itemsCount;
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        // Return a NEW fragment instance in createFragment(int)
        Fragment fragment = new CalculateSightParametersFragment(position);
        //Bundle args = new Bundle();
        // Our object is just an integer :-P
//        args.putInt(DemoObjectFragment.ARG_OBJECT, position + 1);
//        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public int getItemCount() {
        return this.itemsCount;
    }
}

