package lac.contextnet.sddl_longrunningtest.adapters;

import android.support.v4.app.Fragment;

import com.aspsine.fragmentnavigator.FragmentNavigatorAdapter;

import lac.contextnet.sddl_longrunningtest.MapsFragment;
import lac.contextnet.sddl_longrunningtest.SmartphoneFragment;

public class MainFragmentAdapter implements FragmentNavigatorAdapter {

    private static final String TABS[] = {"maps", "smart"};

    @Override
    public Fragment onCreateFragment(int position) {
        Fragment mFragment = null;
        switch (position){
            case 0:
                mFragment = MapsFragment.newInstance(TABS[position]);
                break;
            case 1:
                mFragment = SmartphoneFragment.newInstance(TABS[position]);
                break;
        }
        return mFragment;
    }

    @Override
    public String getTag(int position) {
        return TABS[position];
    }

    @Override
    public int getCount() {
        return TABS.length;
    }
}
