package com.ttiglobal.inttilectgpchat.adapter;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import com.ttiglobal.inttilectgpchat.fragments.Hotspot360;
import com.ttiglobal.inttilectgpchat.fragments.SalesProcessFragment;
import com.ttiglobal.inttilectgpchat.fragments.SuzukiComparisonFragment;
import com.ttiglobal.inttilectgpchat.fragments.SuzukiPersonalizationFragment;


public class ViewPagerAdapter extends FragmentPagerAdapter {

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

    @Override
    public Fragment getItem(int position) {
        Fragment fragment = null;
        if (position == 0) {
            fragment = new Hotspot360();
        } else if (position == 1) {
            fragment = new SuzukiComparisonFragment();
        } else if (position == 2) {
            fragment = new SalesProcessFragment();
        } else if (position == 3) {
            fragment = new SuzukiPersonalizationFragment();
        }
        return fragment;
    }

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

    @Override
    public CharSequence getPageTitle(int position) {
        String title = null;
        if (position == 0) {
            title = "360" + (char) 0x00B0 +" View";
        } else if (position == 1) {
            title = "Comparisons";
        } else if (position == 2) {
            title = "5 Step Demo";
        } else if (position == 3) {
            title = "Personalisation";
        }
        return title;
    }
}
