castorflex / VerticalViewPager

Copy pasted version of the support ViewPager, but vertical!
1.11k stars 305 forks source link

How to set horizontal scrolling #2

Closed gilmaman closed 10 years ago

gilmaman commented 10 years ago

Im using vert scrolling for landscape mode and still want to use horiz scrolling for portrait how can i switch between the two?

thanks

castorflex commented 10 years ago

Unfortunately at this moment it's only Vertical. If you want to use horizontal scrolling, use the original ViewPager. I guess you have to use 2 different xml with ViewPager / VerticalViewPager and check programmatically if your view is a ViewPager or a VerticalViewPager.

if(mView instanceof ViewPager) ((ViewPager)mView).setAdapter(mAdapter);
else ((VerticalViewPager)mView).setAdapter(mAdapter);

You can use the same Adapter though.