4

I use ViewPager with PagerAdapter. Is it possible to implement vertical swipe in Android, where you can scroll between views from top to down and from down to top? I need identical behavior that ViewPager does by default, but in vertical way. I found method canScrollVertically() but it's not what I am looking for I suppose. Thanks in advance

pawelo
  • 1,405
  • 4
  • 15
  • 30
  • This should solve your problem without including external code. [Vertical ViewPager](http://stackoverflow.com/questions/13477820/android-vertical-viewpager/18657771#18657771) – Kulai Sep 18 '13 at 00:12

1 Answers1

4

Natively, no.

However, Jake Wharton has a directional ViewPager that does this.

https://github.com/JakeWharton/Android-DirectionalViewPager/

The only problem is he doesn't support it anymore, but it will get you started. It might even be enough for what you want.

DeeV
  • 35,865
  • 9
  • 108
  • 95
  • Thank you for your reply. I tried to use it, but I stopped because of huge differeces between their and current version of support library. I will probably use ScrollView instead :( – pawelo Jan 29 '13 at 17:21
  • What was the problem? Did you swap out the support library in the project with the new ones? I managed to get it working with my project although it was almost 6 months ago so I don't remember all I had to do. I just know that it works pretty well. – DeeV Jan 29 '13 at 17:54
  • If you say so, I'll try to make another attempt tomorrow. – pawelo Jan 29 '13 at 17:57
  • As much as I enjoy points, you may not want to accept until it works though in case someone has a better solution. That's the only solution I was able to find when I needed to do it. – DeeV Jan 29 '13 at 18:00
  • I have tried using this. It is not compatible with the current library. – input Jan 30 '13 at 00:05
  • @DeeV You answered my first question by telling me that it isn't possible natively. That was what I needed and I saw (and even tested) DirectionalViewPager prior to posting my problem, so I believe You deserve that point. Btw: I decided to use ListView for now instead of this swipe thing. Thx for Your time. – pawelo Jan 30 '13 at 15:38
  • @input It might require some modification, but at the very least it can be used as a starting point if you need a vertical viewpager class. I can tell you that I am using it with the latest compatibility libraries, but I can't recall what as needed to get it to work. – DeeV Jan 30 '13 at 16:08
  • I just wonder why was it deprecated. Did the vertical swipe got added to view pager? There has to be a reason. Anyone aware about it? – Jayshil Dave May 02 '13 at 13:18
  • The directional ViewPager was a custom library that Jake Wharton was working on, but he moved on to ActionbarSherlock. Vertical viewpaging has not been officially added to my knowledge. – DeeV May 02 '13 at 13:29