package ch.pizzalink.android.adapter.pager;

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

import ch.pizzalink.android.fragment.createOrder.CreateOrderResultFragment;
import ch.pizzalink.android.fragment.createOrder.CreateOrderSummaryFragment;
import ch.pizzalink.android.fragment.createOrder.PaymentMethodFragment;
import ch.pizzalink.android.fragment.createOrder.ShippingAddressFragment;
import ch.pizzalink.android.fragment.createOrder.ShippingMethodFragment;

/**
 * Created by cimenmus on 17/10/2017.
 */

public class OrderPagerAdapter extends FragmentPagerAdapter {

    public OrderPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        switch (position){
            case 0:
                return ShippingMethodFragment.newInstance();
            case 1:
                return ShippingAddressFragment.newInstance();
            case 2:
                return PaymentMethodFragment.newInstance();
            case 3:
                return CreateOrderSummaryFragment.newInstance();
            case 4:
                return CreateOrderResultFragment.newInstance();
            default:
                return ShippingMethodFragment.newInstance();
        }
    }

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

    /*
    @Override
    public CharSequence getPageTitle(int position) {
        return "Page " + position;
    }
    */
}