Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ViewPager visualization as a "stair"

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

like image 732
michoprogrammer Avatar asked Nov 25 '25 22:11

michoprogrammer


1 Answers

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

like image 101
Hitesh Sahu Avatar answered Nov 28 '25 15:11

Hitesh Sahu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!