Android Open Source - Android-ExtendedViewPager Description Pager Adapter






From Project

Back to project page Android-ExtendedViewPager.

License

The source code is released under:

MIT License

If you think the Android project Android-ExtendedViewPager 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.onatm.sample.extendedviewpager.adapter;
/*from  w  ww.ja  v  a 2s .c om*/
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.onatm.sample.extendedviewpager.DescriptionFragment;
import com.onatm.sample.extendedviewpager.R;

import java.util.ArrayList;

public class DescriptionPagerAdapter extends FragmentPagerAdapter {

    private ArrayList<Fragment> mFragments;

    private final int[] DESCRIPTIONS = new int[] {
            R.string.hello_world,
            R.string.hello_world
    };

    public DescriptionPagerAdapter(FragmentManager fm) {
        super(fm);
        mFragments = new ArrayList<Fragment>();
        for (int description : DESCRIPTIONS) {
            mFragments.add(new DescriptionFragment(description));
        }
    }

    @Override
    public int getCount() {
        return mFragments.size();
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }
}




Java Source Code List

com.onatm.library.extendedviewpager.ParallaxImageViewPager.java
com.onatm.sample.extendedviewpager.DescriptionFragment.java
com.onatm.sample.extendedviewpager.MainActivity.java
com.onatm.sample.extendedviewpager.adapter.DescriptionPagerAdapter.java