Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImagePagerAdapter #16

Open
norrisboat opened this issue Apr 14, 2015 · 1 comment
Open

ImagePagerAdapter #16

norrisboat opened this issue Apr 14, 2015 · 1 comment

Comments

@norrisboat
Copy link

How do I setup an image page adapter for my pager

@anandinmaddy
Copy link

public class MyImgAdapter extends FragmentPagerAdapter {
    private int mCount = 4;
    private int sliderPosition = 0;

    public MyImgAdapter(FragmentManager fms) {
        super(fms);
    }

    @Override
    public Fragment getItem(int position) {
        sliderPosition = position;
        if (position == 0) {
            return new FirstSlide();
        } else if (position == 1) {
            return new SecondSlide();
        } else if (position == 2) {
            return new ThirdSlide();
        } else {
            return new FourthSlide();
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants