CODEX
33 Viewpager2 Transformers for Your Android ui’s
Animate your Pages with ViewPager2 Page-Transformers
For a seasoned android developer, it is almost impossible to work on any concise android project which does not require the use of a ViewPager, to my experience, on average, eight apps on ten require a ViewPager in one way or another.
A ViewPager
is the widget that allows the user to swipe left or right to see an entirely new screen or page. It is a nice and practical way of displaying tabs or fragments and navigating between them. The ViewPager
, since its release, has served android developers in a great way and is still doing a great job today, but it also has some limitations that eventually led to the birth of ViewPager2
.
ViewPager2
ViewPager2
is an improved version of the ViewPager
library that offers enhanced functionality and addresses common difficulties with using ViewPager
.
ViewPager2
also supports vertical page swiping which ViewPager
does not support.
PageTransformer
A PageTransformer
is a class that is invoked whenever a visible/attached page is scrolled in a ViewPager
or a ViewPager2
, it offers the possibility to execute a custom transformation to page views…