Android Open Source - ViewPager-Android Pager Adapter






From Project

Back to project page ViewPager-Android.

License

The source code is released under:

MIT License

If you think the Android project ViewPager-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.ryanharter.viewpager;
/*from w w w .  j  a va 2 s.c om*/
/**
 * {@inheritDoc}
 */
public abstract class PagerAdapter extends android.support.v4.view.PagerAdapter {

    /**
     * {@inheritDoc}
     * @deprecated Use {@link #getPageSize(int)} instead.
     */
    @Override
    public float getPageWidth(int position) {
        return super.getPageWidth(position);
    }

    /**
     * Returns the proportional size (width or height depending on orientation)
     * of a given page as a percentage of the ViewPager's measured size from (0.f-1.f).
     *
     * @param position The position of the page requested
     * @return Proportional size for the given page position
     */
    public float getPageSize(int position) {
        return getPageWidth(position);
    }
}




Java Source Code List

com.ryanharter.viewpager.PagerAdapter.java
com.ryanharter.viewpager.ViewPager.java
com.ryanharter.viewpager.sample.HorizontalPagingFragment.java
com.ryanharter.viewpager.sample.MainActivity.java
com.ryanharter.viewpager.sample.VerticalPagingFragment.java