package org.deke.risk.riskahead.adapter;

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

import org.deke.risk.riskahead.fragment.ProfileStatisticsFragment;
import org.deke.risk.riskahead.fragment.ReportListFragment;
import org.deke.risk.riskahead.fragment.Top10Fragment;

public class ProfilePagerAdapter extends FragmentStatePagerAdapter {
    int mNumOfTabs;

    public ProfilePagerAdapter(FragmentManager fm, int NumOfTabs) {
        super(fm);
        this.mNumOfTabs = NumOfTabs;
    }

    @Override
    public Fragment getItem(int position) {
        Fragment returnFragment;
        switch (position) {
            case 0:
                returnFragment = new ProfileStatisticsFragment();
                break;
            case 1:
                returnFragment = new Top10Fragment();
                break;
            case 2:
                returnFragment = new ReportListFragment();
                break;
            default:
                return null;
        }
        return returnFragment;
    }

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