Back to project page snakk-ads-android-sample-app.
The source code is released under:
Copyright (c) 2012, Snakk! Media Group All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are m...
If you think the Android project snakk-ads-android-sample-app listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.snakkads.tabsswipe.adapter; /*from www . j av a 2s . c o m*/ import com.snakkads.tabsswipe.BannerAdPromptFragment; import com.snakkads.tabsswipe.BannerInterstitialFragment; import com.snakkads.tabsswipe.BannerRichMediaFragment; import com.snakkads.tabsswipe.BannerStandardMediaFragment; import com.snakkads.tabsswipe.BannerVideoFragment; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; public class TabsPagerAdapter extends FragmentPagerAdapter { public TabsPagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int index) { Fragment fragment = null; switch (index) { case 0: // Standard fragment activity fragment = new BannerStandardMediaFragment(); break; case 1: // Rich Media fragment activity fragment = new BannerRichMediaFragment(); break; case 2: // Interstitial fragment activity fragment = new BannerInterstitialFragment(); break; case 3: // Ad prompt fragment activity fragment = new BannerAdPromptFragment(); break; case 4: // Video fragment activity fragment = new BannerVideoFragment(); break; } return fragment; } @Override public int getCount() { // get item count - equal to number of tabs return 5; } }