Android Open Source - WhatsOnTV Series Collection Pager Adapter






From Project

Back to project page WhatsOnTV.

License

The source code is released under:

GNU General Public License

If you think the Android project WhatsOnTV 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 net.oncaphillis.whatsontv;
/* w  ww .j a  v  a 2 s  . c o m*/
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

public class SeriesCollectionPagerAdapter extends FragmentStatePagerAdapter {
  private int[]    _ids;
  private String[] _names;
  private int      _ix;
  public SeriesCollectionPagerAdapter(FragmentManager fm,int ix,int[] ids,String[] names) {
      super(fm);
      _ix    = ix;
      _ids   = ids;
    _names = names;
    }

    @Override
    public Fragment getItem(int i) {
        Fragment fragment = new SeriesObjectFragment();
        Bundle args       = new Bundle();
        args.putInt(SeriesObjectFragment.ARG_IX, i);
        args.putIntArray("ids", _ids);
        args.putStringArray("names", _names);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public int getCount() {
        return _names.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return "#"+(position+1)+"_"+_names[position];
    }
}




Java Source Code List

net.oncaphillis.whatsontv.AboutActivity.java
net.oncaphillis.whatsontv.BitmapDownloaderTask.java
net.oncaphillis.whatsontv.ErrorActivity.java
net.oncaphillis.whatsontv.MainActivity.java
net.oncaphillis.whatsontv.MainFragment.java
net.oncaphillis.whatsontv.MainPagerAdapter.java
net.oncaphillis.whatsontv.Pager.java
net.oncaphillis.whatsontv.SearchActivity.java
net.oncaphillis.whatsontv.SearchThread.java
net.oncaphillis.whatsontv.SeriesCollectionPagerAdapter.java
net.oncaphillis.whatsontv.SeriesObjectFragment.java
net.oncaphillis.whatsontv.SeriesPagerActivity.java
net.oncaphillis.whatsontv.TmdbKey.java
net.oncaphillis.whatsontv.Tmdb.java
net.oncaphillis.whatsontv.TvSeriesListAdapter.java