Library / SDK
tommybuonomo/dotsindicator avatar
tommybuonomo/dotsindicator

dotsindicator's XML spacing default changes with the indicator type

Dots indicators for Android ViewPager and Compose

3,606 stars361 forksKotlinApache-2.0

At a glance

What is it?
An Android pager-indicator library shipping Compose and XML views from one artifact. The Compose API offers four indicator types and the XML API documents three, the same spacing attribute defaults to 8dp on one indicator and 4dp on the other two, and the view class names still carry the old package name the artifact no longer uses.
Who is it for?
dotsindicator suits a Compose project that wants one of four named indicator types and can pass a pager state directly, or an XML project willing to learn a different attribute vocabulary per indicator. It does not suit a team that needs the two APIs at parity, since Balloon exists only on the Compose side, and it does not suit anyone expecting a stable release signal, because the repository has published no releases at all.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 43 days ago.
What is it written in?
Mainly Kotlin, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 23, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • tommybuonomo/dotsindicator3,606 ★ · +3
Star history
Repository2026-09-242026-11-23
tommybuonomo/dotsindicator3.6k3.6k

3 Stars in the last 60 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The artifact is dotsindicator and the class names are not

The dependency coordinate and the code you write disagree about what this library is called. The artifact is published under the group and name shown in the installation block, which is a short name with no pager in it:

kotlin
repositories {
    google()
    mavenCentral()
}

dependencies {
    implementation("com.tbuonomo:dotsindicator:5.1.2")
}

The XML you write uses the longer name. Every view in the README is declared as a fully qualified class under a package that still says viewpagerdotsindicator, so the plain indicator, the spring one and the worm one all begin with that prefix, while the coordinate you add to your build file does not. The repository agrees with the class names rather than the coordinate: the source tree holds a module directory and a sample directory both named after the old name, and there is no directory named after the new one. So the rename happened at the publishing layer and the code was never renamed with it. Nothing breaks, because the manifest attribute namespace is what binds an XML tag to a class rather than the tag name itself, but it means searching the repository for the artifact name you depend on leads you to the publishing configuration rather than to the sources.

Compose has four types and the XML section documents three

The opening says Compose support is built into the same artifact and exposes four indicator types, and it names them: Shift, Spring, Worm and Balloon. The XML half of the README then documents three views, one for each of the first three. There is no XML view for Balloon, so the two APIs are not at parity and the gap is not called out anywhere in the file. The naming also shifts between them. What Compose calls Shift is, in XML, simply the plain indicator with no adjective at all. Spring and Worm keep their names on both sides, so the mismatch is confined to one type plus one missing type. The parameters differ enough that the shift is not just a rename either. The Compose examples build each type from a dot graphic, and the Spring and Worm variants take two of them, one for the resting dots and one for the active one, with a border colour and a transparent fill so the dots render hollow. The Balloon variant instead takes a single solid dot, a size multiplier expressed as a floating point number, and its own spacing parameter. So the four types are not four presets of one knob set, and a Compose project choosing between them is choosing between two different parameter shapes.

The same spacing attribute defaults to two different values

Three attribute tables sit in the XML half of the file, and one default disagrees between them. The spacing attribute is documented on all three indicators. On the plain indicator its default is eight density-independent pixels. On the spring indicator and again on the worm indicator its default is four. That is the only default in the three tables that differs, which makes it easy to miss and easy to notice once a layout looks wrong after switching indicator type: the dots sit twice as far apart and nothing in the code says why. The examples do not help, because each one overrides the documented default. The plain indicator's example sets four against a default of eight, and the spring indicator's example sets six against a default of four. So a reader copying an example gets a value that is not the default for any of the indicators in the file, which is fine as illustration and unhelpful as a reference. The one default that is consistent across all three is the dot size, which is sixteen on every indicator, along with the clickable toggle, which defaults to true on every indicator.

Each indicator names the same idea differently

Beyond spacing, the three attribute tables share only part of their vocabulary, and the differences are systematic rather than accidental. The plain indicator is the only one with an attribute for the colour of the selected dot, and the only one with a width multiplier that stretches the selected dot horizontally. It is also the only one that can tint every previous dot with the selected colour, through a switch documented as colouring each previous dot with that colour, and the only one with an elevation attribute. The spring and worm indicators have none of those four. What they have instead is an attribute for the colour of the stroke on the background dots, which defaults to the indicator colour, and a stroke width. So the concept of marking the current position is spelled selected-dot colour on one indicator and stroke colour on the other two, and the concept of making the current dot visually wider simply does not exist outside the plain one. Two defaults are shared as derivations rather than numbers: corner radius is described as defaulting to half the dot size on all three, which turns a circle into a dot shape automatically. Migrating between indicator types therefore means re-reading the vocabulary, not just changing a class name.

The README renders a bare == where the badges were

There is a defect in the rendering that anyone reading the file will notice immediately. Between the sentence asking readers to star the project and the sentence inviting issues and enhancement requests, the source contains a line with nothing but an equals sign on each side of nothing. The images that would occupy that line are absent, so what remains is a stray pair of characters with no anchor text and no destination. It is a small artefact of how the file was assembled rather than something a user has to work around, and it is worth naming because it is the kind of thing that makes a project look unmaintained when the commits say otherwise. The badge row at the top has the same character: a link wrapping nothing, with no address and no text, presumably an image that did not survive. Everything else in the file is in good order. The three attribute tables are formatted consistently, every attribute has a description, the defaults are given in the same parenthetical style throughout, and each XML section is followed by the three lines of Kotlin needed to wire it up.

Commits landed on 2026-10-04 and there are no releases

The two maintenance signals disagree, and this time the disagreement runs the other way from most projects in this state. The last push to the repository was on 2026-10-04, so work on the branch is current. The repository has published no GitHub releases at all. Versions exist, because the installation block pins a concrete coordinate at version 5.1.2, and that artefact is on Maven Central, linked by a badge. So the release signal lives in the publishing pipeline rather than in tags, which means a consumer pins a version string and a contributor has no tag to cut against. There is no changelog version visible in the excerpt either; the file ends with a changelog heading and nothing under it. The build side is a modern Gradle setup with version control plugins and a version properties file, a wrapper committed for both platforms, a settings file and a scripts directory, so the publishing path is all there. The build file itself is not among the files provided, so the coordinates, the minimum Android level and the Kotlin and Compose compiler versions the library was built against cannot be read from here.

attachTo is the whole integration

The integration surface is one method and that is a genuine strength rather than a thinness. The file states that classic views remain supported for both pager classes, and that the attach method accepts either the original support-library pager or the newer one, with a two-line snippet showing the same call against each. So a codebase mid-migration, with one screen on the old pager and another on the new one, can use the same indicator class on both, which is the situation that usually forces two libraries. The Compose side is equivalent in spirit and different in shape: there the indicator takes a pager state object from the Compose foundation library directly, and each of the four types is a separate parameter rather than a separate class. Tapping is handled at both layers, with a clickable toggle defaulting to true in the XML tables and a spacing parameter on the Compose side for the type that needs it. Nothing in the file documents behaviour on page change, on empty or single-page indicators, or on rotation, so those are the three cases worth checking in your own layout rather than assuming.

Editorial conclusion

dotsindicator suits a Compose project that wants one of four named indicator types and can pass a pager state directly, or an XML project willing to learn a different attribute vocabulary per indicator. It does not suit a team that needs the two APIs at parity, since Balloon exists only on the Compose side, and it does not suit anyone expecting a stable release signal, because the repository has published no releases at all. Before adding the XML views, note that the same spacing attribute defaults to different values on different indicator types and that the example values override those defaults in every case. The version you depend on comes from Maven Central rather than a tag, so pin the dependency coordinate rather than a commit. Version 5.1.2 is the coordinate shown, and the last push was on 2026-10-04.

Frequently asked questions

What is the dotsindicator library?

An Android library for pager dot indicators, published on Maven Central under the group com.tbuonomo and the artifact name dotsindicator, with version 5.1.2 shown in the dependency block. It offers four Compose indicator types and three XML views, and attaches to both the classic ViewPager and ViewPager2.

Which indicator types does dotsindicator offer?

Four on the Compose side, named Shift, Spring, Worm and Balloon. Three on the XML side, named DotsIndicator, SpringDotsIndicator and WormDotsIndicator. Balloon has no XML counterpart, and the Compose Shift type corresponds to the XML view with no adjective in its name.

How do I attach a dots indicator in XML views?

Declare the view in your layout, then call `attachTo(...)` with the pager instance. The method accepts both the classic ViewPager and ViewPager2, and the indicator is clickable by default so tapping a dot changes the page.

How do I change the appearance of dotsindicator?

Nine XML attributes on the plain indicator, covering colour, selected colour, a progress mode that tints every previous dot, size, spacing, a width multiplier for the selected dot, corner radius, elevation and a clickable toggle. Several have derived defaults, such as a corner radius of half the dot size, and the spacing default differs between indicator types.

Where is dotsindicator published?

On Maven Central, under a short artifact name that does not match the fully qualified class names used in XML layouts, which still carry the older package prefix. The version comes from the dependency declaration rather than a tag, and the repository itself has published no GitHub releases.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. README
  4. tommybuonomo/dotsindicator on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/tommybuonomo-dotsindicator.svg)](https://hysenlabs.com/projects/tommybuonomo-dotsindicator)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/tommybuonomo-dotsindicator.svg)](https://hysenlabs.com/projects/tommybuonomo-dotsindicator)

Was this useful?