I have searched the internet but I couldn\'t find some good explanation or advice. Basically, I want to implement this functionality.
Feel free to use my library available here.
It does exactly what you want and is based on the ViewPager
so you can use it with just a typical PagerAdapter
of your choice.
You can't change the original PERSPECTIVE_SHIFT_FACTOR_X
because it's a private field.
StackView
uses many classes which have package visibility and are only usable in package android.widget.
Furthermore some of those classes are pre-compiled and the source is nowhere to be found, so you can't just copy-paste them and create your own custom StackView
from zero.
You can make the views appear in a column by overriding onLayout
, but once you animate them, their positions are changed back to the default. Sadly the view animations are done in private methods of StackView
so nothing you can do about that either.
You're better of creating your own class that does this, and you can reference the code used in the StackView
source. Creating such a class could be a lot of work and it's definitely not in the scope of a single question.