explaingit

sunfusheng/marqueeview

3,787JavaAudience · developerComplexity · 2/5Setup · easy

TLDR

An Android library that displays scrolling text banners in any of four directions, like a news ticker or announcement strip, configured entirely from XML with no custom animation code needed.

Mindmap

mindmap
  root((MarqueeView))
    What it does
      Scrolling text banner
      Four scroll directions
      Auto cycling items
    Configuration
      XML attributes
      Text style options
      Custom animations
    Data input
      String lists
      Custom objects
      Interface method
    Events
      Tap click listener
      RecyclerView lifecycle
      Stop and start control
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 a scrolling announcement ticker to an Android app's home screen to rotate through promotional messages.

USE CASE 2

Show a list of breaking news headlines that scroll vertically through a banner strip in your app.

USE CASE 3

Display a single long notification message that scrolls horizontally across the screen.

USE CASE 4

Build a tappable scrolling strip where users can tap an item to open a detail screen for that entry.

Tech stack

JavaAndroidGradle

Getting it running

Difficulty · easy Time to first run · 5min

Bintray (the original artifact host) shut down in 2021, verify an alternative Maven coordinate exists before adding the Gradle dependency.

In plain English

MarqueeView is an Android UI component written in Java that displays scrolling text, similar to a ticker strip or announcement banner. It supports four scroll directions: top-to-bottom, bottom-to-top, left-to-right, and right-to-left. Android developers add it to a project through a single Gradle dependency line. Adding it to a screen layout uses standard Android XML. You configure the component with attributes for animation duration, the pause interval between items, text size, text color, alignment (left, center, or right), single-line mode, scroll direction, and font. Once those are set, the view handles the cycling animation on its own. In Java code, you supply a list of strings and call startWithList to begin. For a single long message you call startWithText instead. The library also supports custom data objects: implement a small interface with one method that returns the display text, then pass a list of those objects directly. Custom entry and exit animations can replace the defaults if you want a different visual feel. A click listener lets you respond when a user taps a scrolling item, with access to the item position and text. The README, written primarily in Chinese, includes a note about preventing ghost animations when the component appears inside a ListView or RecyclerView. You call stopFlipping when a view detaches and startFlipping when it reattaches, keeping the animation in sync with the screen lifecycle. The README does not include a license section, contribution guidelines, or test instructions. The package repository linked in the header is Bintray, which shut down in 2021, so the published artifact may no longer be available at that address.

Copy-paste prompts

Prompt 1
I want a top-to-bottom scrolling announcement banner in my Android app using MarqueeView. Show me the XML layout config and Java setup code to display a list of 5 strings.
Prompt 2
How do I add a click listener to MarqueeView so tapping a scrolling item opens the detail screen for that specific announcement?
Prompt 3
I'm using MarqueeView inside a RecyclerView and animations keep ghosting on scroll. What stopFlipping and startFlipping calls do I add to my ViewHolder to fix it?
Prompt 4
How do I pass a list of custom news article objects to MarqueeView so each scrolling item shows a different article title from my data model?
Open on GitHub → Explain another repo

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

Verify against the repo before relying on details.