package be.pzbethanienhuis.kadans.viewactionplan.actionplan;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

/**
 * A pager adapter that represents ScreenSlidePageFragment objects, in
 * sequence.
 */
public class ScreenSlidePagerAdapter extends FragmentStatePagerAdapter {

    // amount of actions/pages
    private static int NUM_ITEMS;

    long[] actionIds;

    public ScreenSlidePagerAdapter(FragmentManager fm, long[] aFragmentIds) {
        super(fm);
        actionIds = aFragmentIds;
        NUM_ITEMS = actionIds.length;
    }

    @Override
    public Fragment getItem(int position) {
        return ScreenSlideFragment.newInstance(actionIds[position]);
    }

    @Override
    public int getCount() {
        return NUM_ITEMS;
    }
}
