{"id":3531,"url":"https://github.com/tommybuonomo/dotsindicator","last_synced_at":"2025-04-23T20:51:49.606Z","repository":{"id":22569598,"uuid":"96710053","full_name":"tommybuonomo/dotsindicator","owner":"tommybuonomo","description":"Three material Dots Indicators for view pagers in Android !  ","archived":false,"fork":false,"pushed_at":"2024-11-21T12:53:31.000Z","size":449,"stargazers_count":3533,"open_issues_count":25,"forks_count":358,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-04-08T23:15:13.473Z","etag":null,"topics":["android","android-library","dots","dots-indicator","indicator","kotlin","kotlin-android","material-design","viewpager","viewpager-indicator"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tommybuonomo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-09T20:38:35.000Z","updated_at":"2025-04-06T18:59:46.000Z","dependencies_parsed_at":"2022-07-09T00:00:30.536Z","dependency_job_id":"609d8521-8f67-44f6-b948-88f3390453a6","html_url":"https://github.com/tommybuonomo/dotsindicator","commit_stats":{"total_commits":167,"total_committers":12,"mean_commits":"13.916666666666666","dds":"0.32335329341317365","last_synced_commit":"6b7ba888bb53e7d4a6ffe15ae6f5b50dc9a08d27"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommybuonomo%2Fdotsindicator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommybuonomo%2Fdotsindicator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommybuonomo%2Fdotsindicator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommybuonomo%2Fdotsindicator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tommybuonomo","download_url":"https://codeload.github.com/tommybuonomo/dotsindicator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250514756,"owners_count":21443208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-library","dots","dots-indicator","indicator","kotlin","kotlin-android","material-design","viewpager","viewpager-indicator"],"created_at":"2024-01-05T20:16:44.148Z","updated_at":"2025-04-23T20:51:49.582Z","avatar_url":"https://github.com/tommybuonomo.png","language":"Kotlin","funding_links":["https://www.buymeacoffee.com/tommybuonomo"],"categories":["Libraries","Kotlin"],"sub_categories":["GUI"],"readme":"# Pager Dots Indicator\n\n![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.tbuonomo/dotsindicator/badge.svg)\n[![Android Arsenal]( https://img.shields.io/badge/Android%20Arsenal-Material%20View%20Pager%20Dots%20Indicator-green.svg?style=flat )]( https://android-arsenal.com/details/1/7127 )\n\u003ca href=\"https://github.com/JStumpp/awesome-android\"\u003e\u003cimg alt=\"awesome\" src=\"https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg\" /\u003e\u003c/a\u003e\n\nDots indicator is an Android library available for Jetpack Compose and XML 🚀\n\n\u003cimg src=\"https://github.com/tommybuonomo/dotsindicator/assets/15737675/77651550-3819-4fbf-8528-0d28c95d4d07\" height=\"500\"/\u003e\n\n\nDon't forget to star the project if you like it! \n![star](https://user-images.githubusercontent.com/15737675/39397370-85f5b294-4afe-11e8-9c02-0dfdf014136a.png)\n == ![heart](https://user-images.githubusercontent.com/15737675/39397367-6e312c2e-4afe-11e8-9fbf-32001b0165a1.png)\n \nFeel free to submit issues and enhancement requests !\n\n## How to\n#### Gradle\n```Gradle\nrepositories {\n    google()\n    mavenCentral()\n}\n\ndependencies {\n    implementation(\"com.tbuonomo:dotsindicator:5.1.0\")\n}\n\n```\n# For Jetpack Compose\n```Kotlin\nColumn {\n    var pageCount by remember { mutableStateOf(5) }\n    val pagerState = rememberPagerState()\n    HorizontalPager(\n        modifier = Modifier.padding(top = 24.dp),\n        pageCount = pageCount,\n        contentPadding = PaddingValues(horizontal = 64.dp),\n        pageSpacing = 24.dp,\n        state = pagerState\n    ) {\n        PagePlaceholderItem()\n    }\n    DotsIndicator(\n        dotCount = pageCount,\n        type = ShiftIndicatorType(dotsGraphic = DotGraphic(color = MaterialTheme.colorScheme.primary)),\n        pagerState = pagerState\n    )\n}\n```\n\n4 types are available in JetpackCompose\n## ShiftIndicatorType\n![ezgif com-crop (1)](https://github.com/tommybuonomo/dotsindicator/assets/15737675/862d7a67-fb78-4767-b5b2-2244dbdbcf31)\n```Kotlin\nDotsIndicator(\n    dotCount = pageCount,\n    type = ShiftIndicatorType(dotsGraphic = DotGraphic(color = MaterialTheme.colorScheme.primary)),\n    pagerState = pagerState\n)\n```\n\n## SpringIndicatorType\n![ezgif com-crop (2)](https://github.com/tommybuonomo/dotsindicator/assets/15737675/3c421473-4492-408d-a4cd-a29a6c18ba51)\n```Kotlin\nDotsIndicator(\n    dotCount = pageCount,\n    type = SpringIndicatorType(\n        dotsGraphic = DotGraphic(\n            16.dp,\n            borderWidth = 2.dp,\n            borderColor = MaterialTheme.colorScheme.primary,\n            color = Color.Transparent\n        ),\n        selectorDotGraphic = DotGraphic(\n            14.dp,\n            color = MaterialTheme.colorScheme.primary\n        )\n    ),\n    pagerState = pagerState\n)\n```\n\n## WormIndicatorType\n![ezgif com-crop (3)](https://github.com/tommybuonomo/dotsindicator/assets/15737675/fdfd8ffc-1581-49f7-8bfd-59f2e118bfac)\n```Kotlin\nDotsIndicator(\n    dotCount = pageCount,\n    type = WormIndicatorType(\n        dotsGraphic = DotGraphic(\n            16.dp,\n            borderWidth = 2.dp,\n            borderColor = MaterialTheme.colorScheme.primary,\n            color = Color.Transparent,\n        ),\n        wormDotGraphic = DotGraphic(\n            16.dp,\n            color = MaterialTheme.colorScheme.primary,\n        )\n    ),\n    pagerState = pagerState\n)\n```\n\n## BalloonIndicatorType\n![ezgif com-crop (4)](https://github.com/tommybuonomo/dotsindicator/assets/15737675/0687f413-96d4-44ac-8923-0be73d76e2b0)\n```Kotlin\nDotsIndicator(\n    dotCount = pageCount,\n    type = BalloonIndicatorType(\n        dotsGraphic = DotGraphic(\n            color = MaterialTheme.colorScheme.primary,\n            size = 8.dp\n        ),\n        balloonSizeFactor = 2f\n    ),\n    dotSpacing = 20.dp,\n    pagerState = pagerState\n)\n```\n# For XML\n## DotsIndicator \n![ezgif com-crop 1](https://user-images.githubusercontent.com/15737675/38328329-e7008c06-384a-11e8-8449-9f2e396d2bc5.gif) ![ezgif com-crop 3](https://user-images.githubusercontent.com/15737675/38328570-8f1e8230-384b-11e8-9be7-738932a4f85e.gif)\n#### In your XML layout\n```Xml\n\u003ccom.tbuonomo.viewpagerdotsindicator.DotsIndicator\n    android:id=\"@+id/dots_indicator\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    app:dotsColor=\"@color/material_white\"\n    app:dotsCornerRadius=\"8dp\"\n    app:dotsSize=\"16dp\"\n    app:dotsSpacing=\"4dp\"\n    app:dotsWidthFactor=\"2.5\"\n    app:selectedDotColor=\"@color/md_blue_200\"\n    app:progressMode=\"true\"\n    /\u003e\n```\n\n#### Custom Attributes\n| Attribute | Description |\n| --- | --- |\n| `dotsColor` | Color of the dots |\n| `selectedDotColor` | Color of the selected dot (by default the `dotsColor`) |\n| `progressMode` | Lets the selected dot color to the dots behind the current one |\n| `dotsSize` | Size in dp of the dots (by default 16dp) |\n| `dotsSpacing` | Size in dp of the space between the dots (by default 4dp) |\n| `dotsWidthFactor` | The dots scale factor for page indication (by default 2.5) |\n| `dotsCornerRadius` | The dots corner radius (by default the half of dotsSize for circularity) |\n\n#### In your Kotlin code\n```Kotlin\n    val dotsIndicator = findViewById\u003cDotsIndicator\u003e(R.id.dots_indicator)\n    val viewPager = findViewById\u003cViewPager\u003e(R.id.view_pager)\n    val adapter = ViewPagerAdapter()\n    viewPager.adapter = adapter\n    dotsIndicator.attachTo(viewPager)\n```\n\n\n## SpringDotsIndicator \n![ezgif com-crop 4](https://user-images.githubusercontent.com/15737675/38329136-2c470ef0-384d-11e8-88a8-c8719dc1d0b7.gif) ![ezgif com-crop 5](https://user-images.githubusercontent.com/15737675/38329293-b87f68a4-384d-11e8-8a04-c560c60dac7c.gif)\n#### In your XML layout\n```Xml\n\u003ccom.tbuonomo.viewpagerdotsindicator.SpringDotsIndicator\n    android:id=\"@+id/spring_dots_indicator\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    app:dampingRatio=\"0.5\"\n    app:dotsColor=\"@color/material_white\"\n    app:dotsStrokeColor=\"@color/material_yellow\"\n    app:dotsCornerRadius=\"2dp\"\n    app:dotsSize=\"16dp\"\n    app:dotsSpacing=\"6dp\"\n    app:dotsStrokeWidth=\"2dp\"\n    app:stiffness=\"300\"\n    /\u003e\n```\n\n#### Custom Attributes\n| Attribute | Description |\n| --- | --- |\n| `dotsColor` | Color of the indicator dot |\n| `dotsStrokeColor` | Color of the stroke dots (by default the indicator color) |\n| `dotsSize` | Size in dp of the dots (by default 16dp) |\n| `dotsSpacing` | Size in dp of the space between the dots (by default 4dp) |\n| `dotsCornerRadius` | The dots corner radius (by default the half of dotsSize for circularity) |\n| `dotsStrokeWidth` | The dots stroke width (by default 2dp) |\n| `dampingRatio` | The damping ratio of the spring force (by default 0.5) |\n| `stiffness` | The stiffness of the spring force (by default 300) |\n\n#### In your Kotlin code\n```Kotlin\n    val springDotsIndicator = findViewById\u003cSpringDotsIndicator\u003e(R.id.spring_dots_indicator)\n    val viewPager = findViewById\u003cViewPager\u003e(R.id.view_pager)\n    val adapter = ViewPagerAdapter()\n    viewPager.adapter = adapter\n    springDotsIndicator.attachTo(viewPager)\n```\n\n\n## WormDotsIndicator \n![ezgif com-crop 6](https://user-images.githubusercontent.com/15737675/38329969-9cf3de2e-384f-11e8-9ada-fa3fbef04d80.gif) ![ezgif com-crop 7](https://user-images.githubusercontent.com/15737675/38330079-f35908fc-384f-11e8-85aa-4daf64c73115.gif)\n\n#### In your XML layout\n```Xml\n\u003ccom.tbuonomo.viewpagerdotsindicator.WormDotsIndicator\n    android:id=\"@+id/worm_dots_indicator\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    app:dotsColor=\"@color/material_blueA200\"\n    app:dotsStrokeColor=\"@color/material_yellow\"\n    app:dotsCornerRadius=\"8dp\"\n    app:dotsSize=\"16dp\"\n    app:dotsSpacing=\"4dp\"\n    app:dotsStrokeWidth=\"2dp\"\n    /\u003e\n```\n\n#### Custom Attributes\n| Attribute | Description |\n| --- | --- |\n| `dotsColor` | Color of the indicator dot |\n| `dotsStrokeColor` | Color of the stroke dots (by default the indicator color) |\n| `dotsSize` | Size in dp of the dots (by default 16dp) |\n| `dotsSpacing` | Size in dp of the space between the dots (by default 4dp) |\n| `dotsCornerRadius` | The dots corner radius (by default the half of dotsSize for circularity) |\n| `dotsStrokeWidth` | The dots stroke width (by default 2dp) |\n\n#### In your Kotlin code\n```Kotlin\n    val wormDotsIndicator = findViewById\u003cWormDotsIndicator\u003e(R.id.worm_dots_indicator)\n    val viewPager = findViewById\u003cViewPager\u003e(R.id.view_pager)\n    val adapter = ViewPagerAdapter()\n    viewPager.adapter = adapter\n    wormDotsIndicator.attachTo(viewPager)\n```\n\n## Support of ViewPager2\nThe `attachTo` can take a `ViewPager` or a `ViewPager2`\n\n## Help Maintenance\nIf you could help me to continue maintain this repo, buying me a cup of coffee will make my life really happy and get much energy out of it.\n\n\u003ca href=\"https://www.buymeacoffee.com/tommybuonomo\" target=\"_blank\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/purple_img.png\" alt=\"Buy Me A Coffee\" style=\"height: auto !important;width: auto !important;\" \u003e\u003c/a\u003e\n\n## Changelog\n### 5.1.0\n- Fix import issues\n- Upgrade AGP versions\n- Migrate repo to Maven Central Repository\n### 5.0\n- Add Jetpack Compose support with 4 types: ShiftIndicatorType, SpringIndicatorType, WormIndicatorType, BalloonIndicatorType\n### 4.3\n- Fix [#144][i144], [#143][i143], [#139][i139], [#135][i135], [#133][i133], [#131][i131], [#126][i126], [#109][i109], [#95][i95], [#93][i93], [#86][i86], [#85][i85], [#80][i80], [#78][i78], [#73][i73], [#68][i68], [#58][i58]\n- Methods `setViewPager` and `setViewPager2` are now deprecated and replaced by `attachTo(...)`\n### 4.2\nFix [#115](https://github.com/tommybuonomo/dotsindicator/issues/115)\nThe library is now on MavenCentral.\nThe library name moves from `com.tbuonomo.andrui:viewpagerdotsindicator` to `com.tbuonomo:dotsindicator`\n### 4.1.2\nFix [#55][i55] and [#56][i56]\n### 4.1.1\nFix crash\n### 4.1\n- Support RTL (fix [#32][i32] and [#51][i51])\n### 4.0\n- Support of ViewPager2 (fix [#40][i40])\n- Convert all the project to Kotlin\n- Migration to AndroidX\n- Fix [#37][i37]: findViewById, causing missing adapter error\n\n### 3.0.3\n- Fix [#20][i20]: Dots indicator initialises with the wrong number of dots initially\n### 3.0.2\n- Add attribute `selectedDotColor` and `progressMode` to `DotsIndicator`\n- Fix RTL issues and improve `DotsIndicator` globally\n### 2.1.0\n- Add attribute `dotsStrokeColor` to `SpringDotsIndicator` and `WormDotsIndicator`\n\n## License\n    Copyright 2016 Tommy Buonomo\n    \n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n    \n        http://www.apache.org/licenses/LICENSE-2.0\n    \n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n[i20]: https://github.com/tommybuonomo/dotsindicator/issues/20\n[i32]: https://github.com/tommybuonomo/dotsindicator/issues/32\n[i37]: https://github.com/tommybuonomo/dotsindicator/issues/37\n[i40]: https://github.com/tommybuonomo/dotsindicator/issues/40\n[i51]: https://github.com/tommybuonomo/dotsindicator/issues/51\n[i55]: https://github.com/tommybuonomo/dotsindicator/issues/55\n[i56]: https://github.com/tommybuonomo/dotsindicator/issues/56\n[i20]: https://github.com/tommybuonomo/dotsindicator/issues/20\n[i32]: https://github.com/tommybuonomo/dotsindicator/issues/32\n[i37]: https://github.com/tommybuonomo/dotsindicator/issues/37\n[i40]: https://github.com/tommybuonomo/dotsindicator/issues/40\n[i51]: https://github.com/tommybuonomo/dotsindicator/issues/51\n[i55]: https://github.com/tommybuonomo/dotsindicator/issues/55\n[i56]: https://github.com/tommybuonomo/dotsindicator/issues/56\n[i144]: https://github.com/tommybuonomo/dotsindicator/issues/144\n[i143]: https://github.com/tommybuonomo/dotsindicator/issues/143\n[i139]: https://github.com/tommybuonomo/dotsindicator/issues/139\n[i135]: https://github.com/tommybuonomo/dotsindicator/issues/135\n[i133]: https://github.com/tommybuonomo/dotsindicator/issues/133\n[i131]: https://github.com/tommybuonomo/dotsindicator/issues/131\n[i126]: https://github.com/tommybuonomo/dotsindicator/issues/126\n[i109]: https://github.com/tommybuonomo/dotsindicator/issues/109\n[i95]: https://github.com/tommybuonomo/dotsindicator/issues/95\n[i93]: https://github.com/tommybuonomo/dotsindicator/issues/93\n[i86]: https://github.com/tommybuonomo/dotsindicator/issues/86\n[i85]: https://github.com/tommybuonomo/dotsindicator/issues/85\n[i80]: https://github.com/tommybuonomo/dotsindicator/issues/80\n[i78]: https://github.com/tommybuonomo/dotsindicator/issues/78\n[i73]: https://github.com/tommybuonomo/dotsindicator/issues/73\n[i68]: https://github.com/tommybuonomo/dotsindicator/issues/68\n[i58]: https://github.com/tommybuonomo/dotsindicator/issues/58\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommybuonomo%2Fdotsindicator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftommybuonomo%2Fdotsindicator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommybuonomo%2Fdotsindicator/lists"}