explaingit

youth5201314/banner

13,027JavaAudience · developerComplexity · 2/5Setup · easy

TLDR

A Java Android library that adds a smoothly looping image carousel to your app, with built-in transition effects, a customizable dot indicator, and automatic pause and resume tied to the activity lifecycle.

Mindmap

mindmap
  root((banner))
    What it does
      Image carousel
      Auto-looping slideshow
      Lifecycle-aware
    Features
      Transition effects
      Dot indicator
      Gallery mode
      Parallax display
    Tech stack
      Java Android
      ViewPager2
      Gradle dependency
    Customization
      Indicator styling
      Swipe delay
      Custom adapter
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add an auto-scrolling image carousel to the top of an Android home screen or product page with a single Gradle dependency.

USE CASE 2

Apply built-in transition effects like zoom-out, depth, rotate, or parallax to a slideshow of promotional images.

USE CASE 3

Customize the dot page indicator's color, size, shape, and position to match your app's design through XML attributes.

USE CASE 4

Show a gallery-style banner that reveals partial neighboring slides at the edges for a layered look.

Tech stack

JavaAndroidViewPager2GradleJetpack

Getting it running

Difficulty · easy Time to first run · 30min

In plain English

This is an Android library that adds an image carousel to a mobile app. A carousel, called a banner in the README, is a UI element that automatically slides through a set of images one after another, commonly used for featured content sections or advertisements at the top of an app screen. Version 2.0 of the library is built on top of ViewPager2, the current Android Jetpack component for swiping between pages. This makes it compatible with the modern androidx package set. Developers add it to a project through Gradle with a single dependency line, and it works without any external image-loading library bundled in, giving teams the freedom to use whichever loading tool they prefer. The library supports horizontal and vertical scrolling, automatic looping with a configurable delay (default three seconds), and swipe-to-turn-off if needed. Several built-in page transition effects are included, such as depth, zoom-out, rotate, scale, and alpha fades, and multiple effects can be layered together. There are also gallery and parallax-style display modes that show partial neighboring slides at the edges. The dot-style page indicator that appears below the images is fully customizable: color, size, spacing, shape, and position can all be adjusted through XML attributes or code. The library provides a base class for building a completely custom indicator if the built-in options do not fit. Setup involves extending a BannerAdapter class (similar to RecyclerView's adapter pattern), attaching the banner to an Activity or Fragment, and calling a lifecycle observer method so the carousel automatically pauses and resumes with the screen. The README is written in Chinese and includes annotated code samples for common use cases.

Copy-paste prompts

Prompt 1
Add the youth5201314 banner carousel to my Android Activity that cycles through 5 images every 3 seconds with a zoom-out transition.
Prompt 2
How do I customize the dot indicator in the banner library to use a custom shape and a different selected color?
Prompt 3
Implement a BannerAdapter for this banner library that loads images from a list of URLs using Glide.
Prompt 4
Set up the banner library lifecycle observer so the carousel automatically pauses when the app goes to the background and resumes when it returns.
Open on GitHub → Explain another repo

← youth5201314 on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.