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

OnPageChangeListener not working with viewpager as a listview row #10

Open
sanjeetchand opened this issue Jun 7, 2014 · 1 comment
Open

Comments

@sanjeetchand
Copy link

I have a listview with rows containing a viewpager. this viewpager has a set of images like gallery.I want to retain the viewpager item, as the user scrolls up or down the listview.

I have tried it many times to make it work by setting the onpagechangelistner but OnPageChangeListener always defaults to zero when scrolling the listview which has the viewpager.

I tried to do the same thing with android.support.v4.view.ViewPager and that one works fine but does not have the looping capability.

@sanjeetchand
Copy link
Author

Ok so I tried commenting the line which sets the current item to 0, in the setAdapter method of the LoopViewPager class and it seems to have solved the issue. When I set and adapter to my viewholder.pager, I do set the current item to my own default, so the change does not make problem for me. so far so good thanks

@OverRide
public void setAdapter(PagerAdapter adapter) {
mAdapter = new LoopPagerAdapterWrapper(adapter);
mAdapter.setBoundaryCaching(mBoundaryCaching);
super.setAdapter(mAdapter);
//setCurrentItem(0, false); <--- this is the line I commented
}

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

1 participant