android viewPager 左右滑動時的錯位視差
阿新 • • 發佈:2019-01-01
viewpager with vertical sliding effects and activity transition
Coding design
Sliding pages to the left or right, as we know, could be implemented by using ViewPager. And fortunately, ViewPager's PagerTransformer is allowed for customization. That's to say, CustPagerTransformer could
get rid of all the parallax effects.
Then, in viewpager's fragment item, vertical slide is an independent module, which could be realized by using ViewDragHelper. In the activity transition part, android OS (above 5.0) makes it easy to transfer to another activity.