# banner: a ViewPager carousel and its RecyclerView twin

> An Android library for carousels and app guide pages that ships two components with the same API: one built on ViewPager with page transformer animation, one built on RecyclerView for large data sets. The indicator is a separate layout you can position, drop or replace, and version 1.6.8 is where the documented history stops.

**ymex/banner** — Android ViewPager rotation control / app guide page control, supports vertical and horizontal cyclic scrolling, extended from ViewPager with animation and indicator support, and more.

- Repository: https://github.com/ymex/banner
- Stars: 100 · Forks: 19
- Language: Java
- License: not declared
- Published: 2026-08-17 · Updated: 2026-08-18 · Language: en
- Canonical page: https://hysenlabs.com/projects/ymex-banner

## Two components, and the trade-off is animation against scale

The library ships two banner components with deliberately overlapping APIs. Banner extends ViewPager, which is where the animation support comes from. RecyclerBanner extends RecyclerView instead, and the README says it holds an advantage in memory use and frame rate, which matters when the carousel has a lot of data, but that its animation effects are harder to implement than with Banner. Everything else is shared: the usage is described as exactly the same, with individual methods unsupported. The one named exception is setPageTransformer, the method that sets the transform animation, which RecyclerBanner does not support. So the choice is made once and early. If the design calls for a page transition effect, take Banner; if the list is long enough that a ViewPager would be wasteful, take RecyclerBanner and give up the transformer.

## The XML attributes are the whole configuration surface

Configuration happens in the layout file, and there are six attributes on the banner itself. banner_interval is the scroll interval and defaults to 5000 milliseconds. banner_auto_play turns automatic playback on, defaulting to true. banner_loop makes the scrolling loop, also defaulting to true. banner_scroll decides whether the user can scroll manually, defaulting to true. banner_orientation chooses the direction, horizontal by default with vertical as the alternative. The sixth arrived later than the others: banner_min_loop sets the minimum number of items that can scroll in a loop, defaults to 1, and is marked as a v1.6.8 addition. That last one is the setting worth knowing about, because it is what stops a carousel with a single item from behaving oddly when looping is enabled.

## The indicator is a child layout you can position or drop

Because Banner is a FrameLayout, the IndicatorLayout that holds the page dots is simply a child view, so its position is yours to decide rather than something the library imposes. Remove it entirely if the design does not want dots, or implement the IndicatorAble interface to replace it with something custom. The indicator's own attributes are as small as the banner's: width and height at 8 dip each by default, margin at 4 dip, a selected and an unselected image or colour, a shape that is circular by default with rectangle as the other option, and indicator_flow, which makes the dots slide along with the content and defaults to false. That flow effect is also unsupported on RecyclerBanner. Two bounds arrived in v1.6.8: indicator_min_dot, the minimum number of dots shown, defaulting to 1, and indicator_max_dot, the maximum, defaulting to 20.

## From layout to data takes four calls

The runtime API is small enough to hold in your head. createView builds the page layout, and it is what you override when a page is not the default image view; the example inflates a custom layout and returns it. bindView is where each page's data reaches its view, taking the view, the data object and the position, and the README's own example loads an image with Glide there. execute is what fills the data in and starts display. setOnClickBannerListener attaches the click callback. Two sets of generics sit underneath: BindViewCallBack takes the type returned by your createView as its first parameter and your data type as the second, and OnClickBannerListener follows the same convention. The default page layout is based on AppCompatImageView, and the data type in the examples is spelled BanneModel, which is a typo carried consistently through the samples.

## The Glide setTag crash and its two documented fixes

One failure is documented at length because anyone loading images with Glide will meet it. The symptom is java.lang.IllegalArgumentException with the message that you must not call setTag() on a view Glide is targeting. The cause is a page layout holding a single ImageView: banner and Glide both operate on setTag() for that view, and Glide treats it as a violation. The README notes that this affected the default layout in versions below v1.6.7, and that v1.6.7 rewrote that layout, so upgrading is the simplest fix. Two workarounds are given for older versions. The first sets Glide's ViewTarget.setTagId to a custom tag id in your Application class, with a matching item declared in ids.xml. The second builds pages through banner.createView(CreateViewCaller.build()) and locates the image with CreateViewCaller.findImageView, a helper added in v1.6.6.

## The default layout was rewritten twice in three versions

The version history is short and explains the design more than the prose does. v1.6.8 is the current version and its entry only says some problems were fixed and some parameters added, which matches the new banner_min_loop and the indicator dot bounds appearing at the same time. v1.6.7 replaced the default layout with a wrapping ImageView layout and changed the loop scroll item limit, which is the release that resolves the Glide conflict. v1.6.6 added the default wrapping ImageView layout in the first place, and CreateViewCaller arrived there too. Going back further, v1.6.5 added the indicator slide effect controlled by indicator_flow, fixed the currentItem position while scrolling and fixed a RecyclerBanner bug; v1.6.2 fixed a RecyclerBanner bounce problem and an indicator that would not display when configured with a colour; v1.6.0 fixed getCurrentItem position, indicator sizing with images, added the default shape attribute and refactored some methods. The 1.5.0 line is where Banner was refactored and RecyclerBanner was added.

## One Gradle line, two support libraries, Apache 2.0

Adding the library is one line in the build file:

```
compile 'cn.ymex:banner:1.6.8'
```

Beyond that, the README states that appcompat-v7 and the RecyclerView support library are required, because the default page layout uses AppCompatImageView and the second component is built on RecyclerView. The configuration shown uses compile, which was a Gradle configuration removed from later releases, so a project on a current Gradle needs the modern equivalent before the dependency resolves. The repository is a Gradle project with the wrapper checked in, gradlew and gradlew.bat alongside a gradle directory, plus a library module under banner/ and a sample module under sample/ with its own build file and ProGuard rules. The licence is Apache 2.0, copyright 2017 ymex.cn, and the README credits RecyclerViewPager by lsjwzh as the source of inspiration. The last commit on record is 21 May 2019.

## Conclusion

banner fits an Android app that needs an onboarding guide page or a rotating feature panel and wants one view class plus an indicator layout rather than a screen of its own, and it is readable in an afternoon since the whole configuration surface is a dozen XML attributes. Three things to know first. The dependency is declared with Gradle's compile configuration, which current Gradle releases no longer provide, so the build file needs adjusting before the project will resolve. The two components are not interchangeable in one respect: setPageTransformer works on Banner and not on RecyclerBanner, so animation work decides which one you take. And the default page layout was rewritten in v1.6.7 to fix a Glide conflict that anyone loading images will otherwise hit. Apache 2.0, version 1.6.8, last commit 21 May 2019.

## FAQ

### What is the ymex banner library?

An Android control for carousels and app guide pages, based on ViewPager, supporting vertical and horizontal loop scrolling with animation and an extensible indicator. It ships a second component, RecyclerBanner, built on RecyclerView. The current version is 1.6.8 and the licence is Apache 2.0.

### How do I add banner to an Android project?

Add the dependency line compile 'cn.ymex:banner:1.6.8' to the build file, and make sure the appcompat-v7 and RecyclerView support libraries are present. Then place the banner in your layout, optionally with an IndicatorLayout child for the page dots.

### What is the difference between Banner and RecyclerBanner?

Banner extends ViewPager and supports the setPageTransformer animation method. RecyclerBanner extends RecyclerView, holds advantages in memory usage and frame rate for large data sets, and does not support that page transformer animation. Otherwise the usage is the same.

### Which attributes control banner timing and looping?

banner_interval sets the scroll interval at 5000 ms by default, banner_auto_play defaults to true, banner_loop defaults to true, banner_scroll allows manual scrolling and also defaults to true, banner_min_loop sets the minimum number of loopable items at 1 from v1.6.8, and banner_orientation is horizontal by default with vertical available.

### What causes the setTag error when using banner with Glide?

A page layout with a single ImageView, because banner and Glide both call setTag() on it. It affected the default layout below v1.6.7, which v1.6.7 rewrote. Workarounds are setting Glide's ViewTarget.setTagId to a custom id declared in ids.xml, or building pages with banner.createView(CreateViewCaller.build()).

## Sources

- [Official README](https://github.com/ymex/banner#readme)
- [Project repository](https://github.com/ymex/banner)
- [README](https://github.com/ymex/banner/blob/master/README.md)
- [Releases](https://github.com/ymex/banner/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/ymex-banner
