package com.vanco.abplayer.adapter;

import com.vanco.abplayer.fragment.DonghuaFragment;

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

/**
 * FragmentPager閫傞厤鍣? * 
 * @author wwj_748
 * @2014/8/9
 */
public class DianyingTabAdapter extends FragmentPagerAdapter {
	// 鍐呭鏍囬
	public static final String[] DONG_HUA_TITLE = new String[] { "鍏ㄥ尯鍔ㄦ€?, "娆х編鐢靛奖",
			"鏃ユ湰鐢靛奖", "鍥戒骇鐢靛奖", "鐢靛奖鐩稿叧" };
	
	public DianyingTabAdapter(FragmentManager fm) {
		super(fm);
		// TODO Auto-generated constructor stub
	}


	// 鑾峰彇椤?	@Override
	public Fragment getItem(int position) {
		System.out.println("Fragment position:" + position);
		
		switch (position) {
		case 0:
			return new DonghuaFragment(23);
		case 1:
			return new DonghuaFragment(145);
		case 2:
			return new DonghuaFragment(146);
		case 3:
			return new DonghuaFragment(147);
		case 4:
			return new DonghuaFragment(82);
		default:
			return new DonghuaFragment(23);
		}
		
		// MainFragment fragment = new MainFragment(position);
		// return fragment;
	}

	@Override
	public CharSequence getPageTitle(int position) {
		// 杩斿洖椤甸潰鏍囬
		return DONG_HUA_TITLE[position % DONG_HUA_TITLE.length].toUpperCase();
	}

	@Override
	public int getCount() {
		// 椤甸潰涓暟
		return DONG_HUA_TITLE.length;
	}

}