3

I'm trying to create a ViewPager for visualize the fragment pages like in this picture:

enter image description here

The page that I'm reading on top of the next two or three pages as a sort of stair. When I swipe to the left, the page go to the left and from the top it arrives the next.

I tried to set the padding top and bottom, but without success

mViewPager.setPadding(0, top, 0, bottom);

I readed this guide ViewPager with previous and next page boundaries but without success.

I saw some library for setting the ViewPager vertical, but I would like to see at least the next two or three pages of my slide, so I guess that a simple vertical viewpager will not solve my problem. https://github.com/castorflex/VerticalViewPager

I'm using the "DepthPageTransformer" animation from here http://developer.android.com/training/animation/screen-slide.html and I tried to modify the scale to 1.25f

private static final float MIN_SCALE = 1.25f;

The result is a page on the bottom of the first one and when I swipe to the left is resized an brought to the front, but is not what I'm trying to reach!

Where I'm doing wrong? Do you think that it would be better using a RecyclerView instead of ViewPager? Thanks

Community
  • 1
  • 1
michoprogrammer
  • 1,159
  • 2
  • 18
  • 45

1 Answers1

3

What you are looking for is called Android StackView This a open source library which you can use in your project :- https://github.com/blipinsk/FlippableStackView

Android stack view

But if you want to do something like tinder cards here is naother good open source library :-

https://github.com/blipinsk/FlippableStackView

Android stack view

Hitesh Sahu
  • 41,955
  • 17
  • 205
  • 154