Search in sources :

Example 1 with MainTabAdapter

use of com.vanco.abplayer.adapter.MainTabAdapter in project ABPlayer by winkstu.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    // 无标题
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    FragmentPagerAdapter adapter = new MainTabAdapter(getSupportFragmentManager());
    // 视图切换器
    ViewPager pager = (ViewPager) findViewById(R.id.pager);
    pager.setOffscreenPageLimit(1);
    pager.setAdapter(adapter);
    // 页面指示器
    PageIndicator indicator = (PageIndicator) findViewById(R.id.indicator);
    indicator.setViewPager(pager);
    /*if (savedInstanceState == null) {
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.container, new SubareaFragment())
                    .commit();
        }*/
    AdManager.getInstance(this).init("118250e2aa39dea9", "bc5f4490f33da8e6", false);
    SpotManager.getInstance(this).loadSpotAds();
    SpotManager.getInstance(this).setAnimationType(SpotManager.ANIM_ADVANCE);
    SpotManager.getInstance(this).setSpotOrientation(SpotManager.ORIENTATION_PORTRAIT);
    AdManager.getInstance(this).setUserDataCollect(true);
}
Also used : PageIndicator(com.viewpagerindicator.PageIndicator) FragmentPagerAdapter(android.support.v4.app.FragmentPagerAdapter) ViewPager(android.support.v4.view.ViewPager) MainTabAdapter(com.vanco.abplayer.adapter.MainTabAdapter)

Aggregations

FragmentPagerAdapter (android.support.v4.app.FragmentPagerAdapter)1 ViewPager (android.support.v4.view.ViewPager)1 MainTabAdapter (com.vanco.abplayer.adapter.MainTabAdapter)1 PageIndicator (com.viewpagerindicator.PageIndicator)1