Android Open Source - Google-IO-Countdown-for-Android Tabs Pager Adapter






From Project

Back to project page Google-IO-Countdown-for-Android.

License

The source code is released under:

GNU General Public License

If you think the Android project Google-IO-Countdown-for-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.javiersantos.googleiocountdown.adapter;
/*w  w w  .jav a  2 s  .  co  m*/
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentPagerAdapter;

public class TabsPagerAdapter extends FragmentPagerAdapter {
  
  public TabsPagerAdapter(android.support.v4.app.FragmentManager fm) {
        super(fm);
    }

  @Override
    public Fragment getItem(int index) {
 
        switch (index) {
        case 0:
            // First fragment activity
          return new HomeFragment();
        //case 1:
            // Second fragment activity
            //return new LiveFragment();
        case 1:
            // Third fragment activity
            return new AboutFragment();
        }
 
        return null;
    }
 
    @Override
    public int getCount() {
        // get item count - equal to number of tabs
        return 2;
    }
 
}




Java Source Code List

com.javiersantos.googleiocountdown.Counter.java
com.javiersantos.googleiocountdown.MainActivity.java
com.javiersantos.googleiocountdown.RobotoFontLight.java
com.javiersantos.googleiocountdown.RobotoFont.java
com.javiersantos.googleiocountdown.WidgetDate.java
com.javiersantos.googleiocountdown.adapter.AboutFragment.java
com.javiersantos.googleiocountdown.adapter.HomeFragment.java
com.javiersantos.googleiocountdown.adapter.LiveFragment.java
com.javiersantos.googleiocountdown.adapter.TabsPagerAdapter.java