ViewPager allows users to swipe left and right through pages of data. Whether you’re a beginner or an experienced Android developer, the right ViewPager library can make a huge difference. It can help you create a smoother and more intuitive user experience and make your app stand out from the crowd. To help you choose the right library for your project, we’ll go through the top 6 Android ViewPager libraries and the features each one offers.
Table of Contents
UltraViewPager
![](https://www.tldevtech.com/wp-content/uploads/tdt/2018/05/ultraviewpager.png)
UltraViewPager is a ViewPager extension that encapsulates multiple features, mainly to provide a unified solution for multi-page switching scenarios. It supports horizontal and vertical scrolling, multi-views in one viewpager, switching views circularly, auto-scrolling, implemented timer with Handler, max-height, max-width, and aspect ratio, built-in indicator, and 2 built-in transition animations.
UltraViewPager ultraViewPager = (UltraViewPager)findViewById(R.id.ultra_viewpager); ultraViewPager.setScrollMode(UltraViewPager.ScrollMode.HORIZONTAL); //initialize UltraPagerAdapter,and add child view to UltraViewPager PagerAdapter adapter = new UltraPagerAdapter(false); ultraViewPager.setAdapter(adapter); //initialize built-in indicator ultraViewPager.initIndicator(); //set style of indicators ultraViewPager.getIndicator() .setOrientation(UltraViewPager.Orientation.HORIZONTAL) .setFocusColor(Color.GREEN) .setNormalColor(Color.WHITE) .setRadius((int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 5, getResources().getDisplayMetrics())); //set the alignment ultraViewPager.getIndicator().setGravity(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM); //construct built-in indicator, and add it to UltraViewPager ultraViewPager.getIndicator().build(); //set an infinite loop ultraViewPager.setInfiniteLoop(true); //enable auto-scroll mode ultraViewPager.setAutoScroll(2000);
Arc Page Indicator
![](https://www.tldevtech.com/wp-content/uploads/tdt/2018/05/arcpageindicator.png)
This is an elevator-like elegant and original page indicator. The indicator uses an ellipse to dispose of indication spots and can draw a hand, like in old elevators. Arc Page Indicator has stunning animations and very original and discreet graphics.
GradationPager
![](https://www.tldevtech.com/wp-content/uploads/tdt/2018/05/gradation_pager.png)
This Android library makes the background color of the view pager naturally move during the swipe.
//Java ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager); viewPager.setAdapter(new PagerAdapter()); // your adapter viewPager.setBackgroundColors(colors); // colors is int array(new int[]) //Kotlin val viewPager:GradationViewPager = findViewById(R.id.viewpager) viewPager.adapter = PagerAdapter() viewPager.setBackGroundColors(colors)
EchantedViewPager
![](https://www.tldevtech.com/wp-content/uploads/tdt/2018/05/enchantedviewpager.png)
EchantedViewPager brings some custom and useful features to ViewPager such as scaling scroll, alpha scroll and swipe-to-dismiss option.
Deck
![](https://www.tldevtech.com/wp-content/uploads/tdt/2018/05/deck.png)
Deck is a ViewPager library that allows you to apply a beautiful animation in your view pager, which looks like a card deck.
MaterialViewPager
![](https://www.tldevtech.com/wp-content/uploads/tdt/2018/05/materialviewpager.png)
This is a ViewPager which comes with a material design.