{"id":13604746,"url":"https://github.com/romandanylyk/PageIndicatorView","last_synced_at":"2025-04-12T02:31:27.300Z","repository":{"id":39381786,"uuid":"66164298","full_name":"romandanylyk/PageIndicatorView","owner":"romandanylyk","description":"An page indicator for Android ViewPager","archived":false,"fork":false,"pushed_at":"2024-08-09T09:56:50.000Z","size":33988,"stargazers_count":4629,"open_issues_count":56,"forks_count":564,"subscribers_count":105,"default_branch":"master","last_synced_at":"2024-11-07T09:43:24.870Z","etag":null,"topics":["android","pageindicatorview","viewpager","viewpager-indicator","viewpagerindicator"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/romandanylyk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-20T19:25:32.000Z","updated_at":"2024-11-02T04:35:22.000Z","dependencies_parsed_at":"2022-09-03T07:52:08.755Z","dependency_job_id":null,"html_url":"https://github.com/romandanylyk/PageIndicatorView","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romandanylyk%2FPageIndicatorView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romandanylyk%2FPageIndicatorView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romandanylyk%2FPageIndicatorView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romandanylyk%2FPageIndicatorView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romandanylyk","download_url":"https://codeload.github.com/romandanylyk/PageIndicatorView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248506901,"owners_count":21115503,"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","pageindicatorview","viewpager","viewpager-indicator","viewpagerindicator"],"created_at":"2024-08-01T19:00:50.813Z","updated_at":"2025-04-12T02:31:26.450Z","avatar_url":"https://github.com/romandanylyk.png","language":"Java","readme":"\n\n### **PageIndicatorView**\n[ ![Download](https://api.bintray.com/packages/romandanylyk/maven/pageindicatorview/images/download.svg) ](https://bintray.com/romandanylyk/maven/pageindicatorview/_latestVersion)[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-PageIndicatorView-green.svg?style=true)](https://android-arsenal.com/details/1/4555)  \n[![API](https://img.shields.io/badge/API-14%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=14)\n\n\n`PageIndicatorView` is light library to indicate ViewPager's selected page with different animations and ability to customise it as you need.\n\n![](https://raw.githubusercontent.com/romandanylyk/PageIndicatorView/master/assets/preview_anim_drop.gif)\n\n### **Integration**\nTo add `pageindicatorview` to your project, first make sure in root `build.gradle` you have specified the following repository:\n```groovy\n    repositories {\n        jcenter()\n    }\n```\n\u003e***Note***: by creating new project in Android Studio it will have `jcenter` repository specified by default, so you will not need to add it manually.\n\nOnce you make sure you have `jcenter` repository in your project, all you need to do is to add the following line in `dependencies` section of your project `build.gradle`.\n \nSee latest library version [ ![Download](https://api.bintray.com/packages/romandanylyk/maven/pageindicatorview/images/download.svg) ](https://bintray.com/romandanylyk/maven/pageindicatorview/_latestVersion)\n```groovy\nimplementation 'com.romandanylyk:pageindicatorview:X.X.X'\n```\nIf your project already use `appcompat-v7` support library, you can omit `PageIndicatorView` dependencies by adding a single .aar file to your project, that will decrease total amount of methods used in your project.\n\n```groovy\nimplementation 'com.romandanylyk:pageindicatorview:X.X.X@aar'\n```\n\nKeep in mind, that `PageIndicatorView` has min [API level 14](https://developer.android.com/about/dashboards/index.html) and these dependencies:\n\n```groovy\nimplementation 'com.android.support:appcompat-v7:27.1.1'\nimplementation 'com.android.support:recyclerview-v7:27.1.1'\nimplementation 'com.android.support:support-core-ui:27.1.1'\n```\n\n### **Usage Sample**\nUsage of `PageIndicatorView` is quite simple. All you need to do is to declare a view in your `layout.xml`  and call `setSelection` method to select specific indicator - that's it!\n\n```java\nPageIndicatorView pageIndicatorView = findViewById(R.id.pageIndicatorView);\n        pageIndicatorView.setCount(5); // specify total count of indicators\n        pageIndicatorView.setSelection(2);\n```\n\n\nBut if you're as lazy as I'm - then there is another option to handle `PageIndicatorView` \n\n```xml\n     \u003ccom.rd.PageIndicatorView\n        android:id=\"@+id/pageIndicatorView\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerInParent=\"true\"\n        app:piv_animationType=\"scale\"\n        app:piv_dynamicCount=\"true\"\n        app:piv_interactiveAnimation=\"true\"\n        app:piv_selectedColor=\"@color/gray_50\"\n        app:piv_unselectedColor=\"@color/gray_300\"\n        app:piv_viewPager=\"@id/viewPager\"\n        attrs:piv_padding=\"12dp\"\n        attrs:piv_radius=\"8dp\" /\u003e\n```\nAll the `piv_` attributes here are specific for `PageIndicatorView` so you can customise it as you want with attributes - pretty handy. \n\nBut what is more important here is  `app:piv_viewPager=\"@id/viewPager\"`.\nWhat it actually do is catch up your `ViewPager` and automatically handles all the event's to selected the right page - so you don't need to call `setSelection` method on your own.\n\nAnother handy options here that works with your `ViewPager` as a whole is \n`app:piv_dynamicCount=\"true\"` and ` app:piv_interactiveAnimation=\"true\"` \n\nDynamic count will automatically updates `PageIndicatorView` total count as you updates pages count in your `ViewPager` - so that's pretty useful.\n\nWhile interactive animation will progress the animation process within your swipe position, which makes animation more natural and responsive to end user.\n\n\n\u003e ***Note***:  Because `setViewPagerId` uses an instance of `ViewPager`, using it in recycler could lead to id conflicts, so `PageIndicatorView` will not know properly what is the right `ViewPager` to work with. Instead you should handle selected indicators on your own programatically.\n\n\n```java\n  pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {\n            @Override\n            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {/*empty*/}\n\n            @Override\n            public void onPageSelected(int position) {\n                pageIndicatorView.setSelection(position);\n            }\n\n            @Override\n            public void onPageScrollStateChanged(int state) {/*empty*/}\n        });\n```\n\n\nHere you can see all the animations `PageIndicatorView` support.\n\nName| Support version| Preview\n-------- | --- | ---\n`AnimationType.NONE`| 0.0.1 | ![anim_none](https://raw.githubusercontent.com/romandanylyk/PageIndicatorView/master/assets/anim_none.gif)\n`AnimationType.COLOR`| 0.0.1 |![anim_color](https://raw.githubusercontent.com/romandanylyk/PageIndicatorView/master/assets/anim_color.gif)\n`AnimationType.SCALE`| 0.0.1 |![anim_scale](https://raw.githubusercontent.com/romandanylyk/PageIndicatorView/master/assets/anim_scale.gif)\n`AnimationType.SLIDE`| 0.0.1 |![anim_slide](https://raw.githubusercontent.com/romandanylyk/PageIndicatorView/master/assets/anim_slide.gif)\n`AnimationType.WORM`| 0.0.1 |![anim_worm](https://raw.githubusercontent.com/romandanylyk/PageIndicatorView/master/assets/anim_worm.gif)\n`AnimationType.FILL`| 0.0.6 |![anim_worm](https://raw.githubusercontent.com/romandanylyk/PageIndicatorView/master/assets/anim_fill.gif)\n`AnimationType.THIN_WORM`| 0.0.7 |![anim_thin_worm](https://raw.githubusercontent.com/romandanylyk/PageIndicatorView/master/assets/anim_thin_worm.gif)\n`AnimationType.DROP`| 0.1.0 |![anim_drop](https://raw.githubusercontent.com/romandanylyk/PageIndicatorView/master/assets/anim_drop.gif)\n`AnimationType.SWAP`| 0.1.1 |![anim_swap](https://raw.githubusercontent.com/romandanylyk/PageIndicatorView/master/assets/anim_swap.gif)\n\n\n### **Release Note**\nSee release notes on [github releases](https://github.com/romandanylyk/PageIndicatorView/releases) or [Bintray release notes](https://bintray.com/romandanylyk/maven/pageindicatorview#release).\n\n### **License**\n\n    Copyright 2017 Roman Danylyk\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","funding_links":[],"categories":["ViewPager","Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromandanylyk%2FPageIndicatorView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromandanylyk%2FPageIndicatorView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromandanylyk%2FPageIndicatorView/lists"}