{"id":13641814,"url":"https://github.com/BeppiMenozzi/ArcPageIndicator","last_synced_at":"2025-04-20T11:32:36.453Z","repository":{"id":217102316,"uuid":"78868366","full_name":"BeppiMenozzi/ArcPageIndicator","owner":"BeppiMenozzi","description":"Android Page Indicator for ViewPager with original animations. It uses an ellipse to dispose indication spots, and can draw a hand, like in old elevators. ","archived":false,"fork":false,"pushed_at":"2017-02-06T16:55:18.000Z","size":4978,"stargazers_count":74,"open_issues_count":0,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-03T01:25:03.510Z","etag":null,"topics":["android","android-library","android-ui","animation","animations","arc","clock","ellipse","graphics","indicator","indicators","material-design","material-ui","needle","viewpager","viewpager-indicator","viewpagerindicator","viewpagers"],"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/BeppiMenozzi.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-01-13T17:03:18.000Z","updated_at":"2024-07-23T03:34:17.000Z","dependencies_parsed_at":"2024-01-14T16:09:27.393Z","dependency_job_id":null,"html_url":"https://github.com/BeppiMenozzi/ArcPageIndicator","commit_stats":null,"previous_names":["beppimenozzi/arcpageindicator"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeppiMenozzi%2FArcPageIndicator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeppiMenozzi%2FArcPageIndicator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeppiMenozzi%2FArcPageIndicator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeppiMenozzi%2FArcPageIndicator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BeppiMenozzi","download_url":"https://codeload.github.com/BeppiMenozzi/ArcPageIndicator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223827748,"owners_count":17209837,"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","android-ui","animation","animations","arc","clock","ellipse","graphics","indicator","indicators","material-design","material-ui","needle","viewpager","viewpager-indicator","viewpagerindicator","viewpagers"],"created_at":"2024-08-02T01:01:24.674Z","updated_at":"2025-04-20T11:32:36.423Z","avatar_url":"https://github.com/BeppiMenozzi.png","language":"Java","readme":"# ArcPageIndicator\nBored of the usual small points or stressed by the space occupied by a tab bar?\u003cbr\u003e\nTry this elevator-like elegant and original page indicator!\nA fully customizable super-easy Page Indicator, with stunning animations and very original and discreet graphics, for Android. Needs a very small screen, perfect when many pages need to be shown and reached in a small time.\n\u003cbr\u003e\n\n\u003cimg src=\"gifs/page.gif\" height=\"360\"\u003e\n\u003cbr\u003e\n\n\n- [x] Out-of-the-box working indicator\n- [x] Fully customizable and styleable\n- [x] Can be programmatically controlled\n- [x] Includes rather complex ellipses calculations :-)\n\n\u003cimg src=\"gifs/elevator.jpg\" height=\"170\"\u003e\u003cbr\u003e\nAn old elevator that inspired this project.\n\n### Setup (Gradle)\nIn your project's build.gradle file:\n\n    allprojects {\n        repositories {\n            ...\n            maven { url \"https://jitpack.io\" }\n            ...\n        }\n    }\n    \nIn your Application's or Module's build.gradle file:\n\n    dependencies {\n        ...\n        compile 'com.github.BeppiMenozzi:ArcPageIndicator:1.0.2'\n        ...\n    }\n    \n### Minimal usage\nLayout for bottom 180° ellipse:\n\n    ...\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    ...\n    \u003cit.beppi.arcpageindicator.ArcPageIndicator\n        android:id=\"@+id/arc_pi\"\n        android:layout_width=\"400dp\"\n        android:layout_height=\"120dp\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_centerHorizontal=\"true\"\n        app:apiArcOrientation=\"toUp\"\n        app:apiViewPager=\"@id/view_pager\"\n        /\u003e\n\nLayout for upper-left 90° ellipse:\n\n    ...\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    ...\n    \u003cit.beppi.arcpageindicator.ArcPageIndicator\n        android:id=\"@+id/arc_pi\"\n        android:layout_width=\"120dp\"\n        android:layout_height=\"120dp\"\n        android:layout_alignParentTop=\"true\"\n        android:layout_alignParentLeft=\"true\"\n        app:apiArcOrientation=\"toDownRight\"\n        app:apiViewPager=\"@id/view_pager\"\n        /\u003e\n\n### Attributes description\nList of attributes with description:\n\u003ctable\u003e\n\u003ctr\u003e\u003cth colspan=\"2\"\u003eGeneral\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eapiViewPager\u003c/b\u003e\u003c/td\u003e\u003ctd\u003eThe ViewPager associated to the Indicator\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003cth colspan=\"2\"\u003eArc appearance\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eapiArcOrientation\u003c/b\u003e\u003c/td\u003e\u003ctd\u003eOrientation of the \"belly\" of the arc. This parameter also affects if the arc will be 90° (corner arc) or 180° (edge arc)\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003cth colspan=\"2\"\u003eSpot appearance\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eapiSpotsColor\u003c/b\u003e\u003c/td\u003e\u003ctd\u003eColor of the spots\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eapiSelectedSpotColor\u003c/b\u003e\u003c/td\u003e\u003ctd\u003eColor of the selected spot\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eapiSpotsRadius\u003c/b\u003e\u003c/td\u003e\u003ctd\u003eSize of the spots\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eapiSpotsShape\u003c/b\u003e\u003c/td\u003e\u003ctd\u003eShape of the spots: Circle, RoundedSquare or Square\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003cth colspan=\"2\"\u003eSpots distribution and movement\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eapiIntervalMeasure\u003c/b\u003e\u003c/td\u003e\u003ctd\u003eHow spots are distributed on the circumference: constant angle or constant arc length. With constant angle, the spots will not be distributed evenly, because of ellipse's eccentricity. Normally constant arc length is used: being a non-finite math problem, here an approximation function is used, as explained later on.\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eapiInvertDirection\u003c/b\u003e\u003c/td\u003e\u003ctd\u003eIf spots will be selected in inverted direction\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eapiAnimationType\u003c/b\u003e\u003c/td\u003e\u003ctd\u003eSee below to detailed explanation of animation types\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003cth colspan=\"2\"\u003eHand appearance\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eapiHandEnabled\u003c/b\u003e\u003c/td\u003e\u003ctd\u003eIf hand is drawn\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eapiHandColor\u003c/b\u003e\u003c/td\u003e\u003ctd\u003eHand's color\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eapiHandWidth\u003c/b\u003e\u003c/td\u003e\u003ctd\u003eHand's width\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eapiHandRelativeLength\u003c/b\u003e\u003c/td\u003e\u003ctd\u003eHand's relative length starting from center to edges (1 = full length)\u003c/td\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\n### Animation types\nList of animation types:\n\u003ctable\u003e\n\u003ctr\u003e\u003cth\u003eName\u003c/th\u003e\u003cth\u003etoBottomRight\u003c/th\u003e\u003cth\u003etoUp\u003c/th\u003e\u003cth\u003eNotes\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eColor\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/c01.gif\" height=\"120\"\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/e01.gif\" height=\"90\"\u003e\u003c/td\u003e\u003ctd\u003e\u003ch6\u003eColor cross-fade\u003c/h6\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eSlide\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/c02.gif\" height=\"120\"\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/e02.gif\" height=\"90\"\u003e\u003c/td\u003e\u003ctd\u003e\u003ch6\u003eSimple movement\u003c/h6\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003ePinch\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/c03.gif\" height=\"120\"\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/e03.gif\" height=\"90\"\u003e\u003c/td\u003e\u003ctd\u003e\u003ch6\u003eSimple movement\u003cbr\u003ewith size reduction\u003c/h6\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eBump\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/c04.gif\" height=\"120\"\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/e04.gif\" height=\"90\"\u003e\u003c/td\u003e\u003ctd\u003e\u003ch6\u003eSimple movement\u003cbr\u003ewith size growth.\u003cbr\u003e\u003ci\u003eMight need additional padding\u003c/i\u003e\u003c/h6\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eRotate\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/c05.gif\" height=\"120\"\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/e05.gif\" height=\"90\"\u003e\u003c/td\u003e\u003ctd\u003e\u003ch6\u003eInverted movement of all spots\u003c/h6\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eRotate Pinch\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/c06.gif\" height=\"120\"\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/e06.gif\" height=\"90\"\u003e\u003c/td\u003e\u003ctd\u003e\u003ch6\u003eInverted movement of all spots\u003cbr\u003ewith size reduction\u003c/h6\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eCover\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/c07.gif\" height=\"120\"\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/e07.gif\" height=\"90\"\u003e\u003c/td\u003e\u003ctd\u003e\u003ch6\u003eSpots are filled from inside\u003c/h6\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eFill\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/c08.gif\" height=\"120\"\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/e08.gif\" height=\"90\"\u003e\u003c/td\u003e\u003ctd\u003e\u003ch6\u003eSpots are empty and filled from inside\u003c/h6\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eSurround\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/c10.gif\" height=\"120\"\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/e10.gif\" height=\"90\"\u003e\u003c/td\u003e\u003ctd\u003e\u003ch6\u003eSimple movement of a circle\u003cbr\u003esurrounding smaller spots\u003c/h6\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eNecklace\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/c11.gif\" height=\"120\"\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/e11.gif\" height=\"90\"\u003e\u003c/td\u003e\u003ctd\u003e\u003ch6\u003eInverted movement of all spots,\u003cbr\u003ewith center spot biggest\u003cbr\u003eand lateral spots smaller\u003c/h6\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eNecklace 2\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/c12.gif\" height=\"120\"\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/e12.gif\" height=\"90\"\u003e\u003c/td\u003e\u003ctd\u003e\u003ch6\u003eInverted movement of all spots,\u003cbr\u003ewith selected spot biggest\u003cbr\u003eand farthest spot smallest\u003c/h6\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\u003ctable\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eExample of hand\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/c13.gif\" height=\"120\"\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/e13.gif\" height=\"90\"\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003eExample of rounded squared spots\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/c14.gif\" height=\"120\"\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"gifs/e14.gif\" height=\"90\"\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\n### New in 1.0.2\n* Fixed a crash when the ViewPager was not found\n* Added setViewPager(), to attach the Indicator to dynamically created viewpagers, by referring the Object and not the id reference number\n\n### Some maths\n\u003ca href=\"http://math.stackexchange.com/questions/2093569/points-on-an-ellipse\"\u003eThis question I made\u003c/a\u003e helped me solve the\nellipse's problem. Indeed, finding arcs of constant length on a known ellipse is a problem with a non-finite solution, that needs integrals to be calculated. There were at least 5 approaches to solve this problem with acceptable performance:\n\n* find the points recursively, by iteratively reducing the error until it's close enough to zero. Pros: easy to do. Cons: adds a indetermined (although very small) time to the drawing process\n* create a big table of sampled data and storing them to provide a database of pre-calculated solutions. Pros: fastest. Cons: can't work for *any* number of elements\n* distribute the points on the radius and project them on the circumference. Pros: very fast. Cons: error still pretty large\n* use an approximated function. Pros: fast and good enough. Cons: never perfect\n* calculate the elliptic integrals. Pros: perfect. Cons: very very very heavy on performance\n\nI chose to find a good approximated function and that is what you can find inside the code, it's fast enough and the error is near to invisibility. In case you need more performance, you can remove the e6 part of the formula and have a slightly bigger error.\n\nThe formula used is the one of the referenced question, and thanks very much to its author, \u003ca href=\"http://math.stackexchange.com/users/299599/ng-chung-tak\"\u003eNg Chung Tak\u003c/a\u003e that is both the author of the answer, and the author of the formula itself.\n\n\nAuthor\n-------\n* Beppi Menozzi\n* \u003ca href=\"http://math.stackexchange.com/users/299599/ng-chung-tak\"\u003eNg Chung Tak\u003c/a\u003e formula's author\n\n\nLicense\n-------\n    The MIT License (MIT)\n\n    Copyright (c) 2016 Beppi Menozzi\n\n    Permission is hereby granted, free of charge, to any person obtaining a copy\n    of this software and associated documentation files (the \"Software\"), to deal\n    in the Software without restriction, including without limitation the rights\n    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n    copies of the Software, and to permit persons to whom the Software is\n    furnished to do so, subject to the following conditions:\n\n    The above copyright notice and this permission notice shall be included in all\n    copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n    SOFTWARE.\n\n","funding_links":[],"categories":["ViewPager"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBeppiMenozzi%2FArcPageIndicator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBeppiMenozzi%2FArcPageIndicator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBeppiMenozzi%2FArcPageIndicator/lists"}