Add an auto-looping image banner to the top of your Android shopping or media app.
Show a peek of the previous and next images so users know there is more content to swipe through.
Display a fully custom dot or dash indicator that animates as the user swipes between pages.
Replicate the banner style used by popular apps like Bilibili or Taobao in your own Android project.
Distributed via JitPack, add the JitPack maven URL to your project build.gradle and the dependency to your module build.gradle.
BannerViewPager is an Android library for building image carousels, commonly called banners, inside mobile apps. A banner is the horizontally scrolling set of images you see at the top of apps like shopping platforms, music apps, or video services. This library handles all the mechanics of that: automatic looping, swipe gestures, smooth transitions between pages, and the small dot or line indicators that show which page you are on. The library is built on top of Android's ViewPager2 component, which is the current standard way to handle swipeable page views in Android. The author notes that popular Chinese apps including Tencent Video, QQ Music, Taobao, and Bilibili all use banner patterns that BannerViewPager can replicate. There are several display styles you can choose from. The default shows one image at a time filling the full width. Other styles show part of the previous and next pages peeking in from the edges, so users can see there is more content to swipe to. You can also configure the pages to overlap or scale relative to each other as they scroll. The indicator system, which is the row of dots or dashes showing the current page position, is a separate library called ViewPagerIndicator that was split out from this project. It supports three visual shapes (circle, dash, and rounded rectangle) and five animation styles for how the indicator moves when you swipe. You can also build a fully custom indicator by extending a base class and drawing whatever shape you want. The library supports Android devices running API level 19 and above, which covers Android 4.4 and later. It is distributed through JitPack, a service that lets Android projects pull libraries directly from GitHub. Integration is done by adding a few lines to the project's build files and then adding the view component to an XML layout. Full documentation is on the project's wiki.
← zhpanvip on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.