package com.cygnusa.hyperm.adapter;

import android.content.Context;

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

import com.cygnusa.hyperm.fragments.Hotspot360;
import com.cygnusa.hyperm.fragments.ProductVideosFragment;
import com.cygnusa.hyperm.fragments.SalesProcessFragment;
import com.cygnusa.hyperm.fragments.HypermComparisonFragmentNew;
import com.cygnusa.hyperm.fragments.HypermPersonalizationFragment;


public class ViewPagerAdapter extends FragmentPagerAdapter {

    private final Context context;

    public ViewPagerAdapter(Context c,FragmentManager fm) {
        super(fm);
        this.context = c;
    }

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

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

    @Override
    public CharSequence getPageTitle(int position) {
        String title = null;
        if (position == 0) {
            title = "360" + (char) 0x00B0 + " View";
        } else if (position == 1) {
            title = "5 Step Demo";
        } else if (position == 2) {
            title = "Personalisation";
        } else if (position == 3) {
            title = "Comparisons";
        } else if (position == 4) {
            title = "Product Videos";
        }
        return title;
    }
//    public View getTabView(int position) {
//        // Given you have a custom layout in `res/layout/custom_tab.xml` with a TextView and ImageView
//        View v = LayoutInflater.from(context).inflate(R.layout.tab_item, null);
//        TextView tv = (TextView) v.findViewById(R.id._text);
//        tv.setText(tabTitles[position]);
//
//        return v;
//    }

}
