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

VerticalPagerAdapter extends FragmentPagerAdapter #4

Open
DanChaltiel opened this issue Feb 19, 2016 · 2 comments
Open

VerticalPagerAdapter extends FragmentPagerAdapter #4

DanChaltiel opened this issue Feb 19, 2016 · 2 comments

Comments

@DanChaltiel
Copy link

Hi,

In your example, there could be a way VerticalPagerAdapter could extend FragmentPagerAdapter.

For now, I have to override your instantiateItem() like this :

pager.setAdapter(new DoubleViewPagerAdapter(getApplicationContext(), verticalAdapters){
    @Override
    public Object instantiateItem(final ViewGroup container, int position) {
        VerticalViewPager childVP = (VerticalViewPager) super.instantiateItem(container, position);
        childVP.setId(R.id.dummyId);
        return childVP;
    }
});

This way I dont have an error at instantiation, but the horizontal swiping is not working yet.

Maybe you can change your code and set childVP an id ?
ViewPagers need an id to work with fragments.

Thanks.

@DanChaltiel
Copy link
Author

I actually had to restart from scratch. Here is my lib.
I linked up yours in the readme for when you don't need fragments.

@bogomazov
Copy link

bogomazov commented Aug 23, 2016

Thank you, Dan! I was about to write my own too!
juliome10 should add this in README to work with Fragments.

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