{"id":24714458,"url":"https://github.com/ml-opensource/cutoutviewindicator","last_synced_at":"2025-10-09T12:31:40.250Z","repository":{"id":83709905,"uuid":"64439009","full_name":"ml-opensource/CutoutViewIndicator","owner":"ml-opensource","description":"Android indicator for ViewPagers and so forth","archived":false,"fork":false,"pushed_at":"2019-10-15T04:41:43.000Z","size":622,"stargazers_count":21,"open_issues_count":10,"forks_count":3,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-05-07T16:46:45.276Z","etag":null,"topics":["android","customizable","indicator","viewpager"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/ml-opensource.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","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":"2016-07-29T01:06:05.000Z","updated_at":"2024-05-07T16:46:50.984Z","dependencies_parsed_at":"2023-04-16T06:00:30.148Z","dependency_job_id":null,"html_url":"https://github.com/ml-opensource/CutoutViewIndicator","commit_stats":null,"previous_names":["ml-opensource/cutoutviewindicator"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ml-opensource%2FCutoutViewIndicator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ml-opensource%2FCutoutViewIndicator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ml-opensource%2FCutoutViewIndicator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ml-opensource%2FCutoutViewIndicator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ml-opensource","download_url":"https://codeload.github.com/ml-opensource/CutoutViewIndicator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235820061,"owners_count":19050101,"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","customizable","indicator","viewpager"],"created_at":"2025-01-27T08:16:41.493Z","updated_at":"2025-10-09T12:31:34.826Z","avatar_url":"https://github.com/ml-opensource.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Flexible Indicators for Android\n===============================\n\n[![Build Status](https://travis-ci.org/fuzz-productions/CutoutViewIndicator.svg?branch=master)](https://travis-ci.org/fuzz-productions/CutoutViewIndicator)\n\nThese indicators animate every little touch on your [ViewPager][1].\n\nWant to use a [SpinningViewPager][2] instead? Just [enable an offset][3]\nand you're good to go. Need even finer control? Under the hood,\n**CutoutViewIndicator** extends LinearLayout; cell styling is done\nthrough LayoutParams. You can set individual values dynamically on\nthese params and Android's View save/restore state logic will keep\nthem in order.\n\nYou can define each cell directly in your xml file, or add them manually.\nNote that the Generators shipped with this library only support\nImageViews and TextViews. We expect the vast majority of integrations\nwill be satisfied with the default Generator choices.\n\nThere is functional support for RecyclerViews in the included\nmobile app code - check out [RecyclerStateProxy][4] for details.\n\nPictures:\n---------\n\nThe sample mobile app in use:\n\n![An Android device screen, its background a light blue. Near the top \nlies a dark blue ViewPager - just 20 dp below it is a row of narrow\nrectangles, all but one of which are dark blue too. One of these\nrectangles, however, is orange. As the animated gif plays, we see\nthe ViewPager page to new views. The orange bar underneath reliably\nindicates exactly which page is currently showing, mimicking the\nslightest perturbation in the ViewPager](http://i.imgur.com/fKOez3z.gif)\n\n![Sample scrolling effect with ClippedImageCellGenerator and\nRecyclerView. The RecyclerView scrolls vertically through colored\nrectangles, each a child View, each equal in width and height to the\nRecyclerView itself. An indicator on the left side mirrors these\nmovements with a star-shaped indicator. Thanks to the\nClippedImageCellGenerator, the star appears to move under the views,\nshowing only half of itself when half of the associated cell\nis visible.](http://i.imgur.com/WwhvqT3.gif)\n\nThere's demo source code for mobile under the `mobile` directory; we're\nlooking to expand compatibility to Android Wear and Android TV too.\n\nAdding to a gradle project:\n---------------------------\n\nIn your app-level `build.gradle`: ensure your repository list includes\njitpack.io, then add the artifact as a dependency.\n\n```\nrepositories {\n    maven {\n        url \"https://jitpack.io\"\n    }\n}\n```\n```\ndependencies {\n    compile 'com.github.fuzz-productions:CutoutViewIndicator:v0.9.0'\n}\n```\n\n\nSample code:\n------------\n\nAdd a view like this to your xml layout.\n```\n\u003ccom.fuzz.indicator.CutoutViewIndicator\n        android:id=\"@+id/indicator\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_below=\"@id/cutoutViewIndicator\"\n        android:orientation=\"horizontal\"\n        app:rcv_drawable=\"@drawable/indicator\"\n        app:rcv_drawable_unselected=\"@drawable/indicator_background\"\n        app:rcv_internal_margin=\"@dimen/indicator_internal_spacing\"\n        app:rcv_tools_indicator_count=\"4\"\n        /\u003e\n```\n\nNote that `rcv_drawable` and `rcv_drawable_unselected` default to 0.\nYou won't see the indicator unless `rcv_drawable` is set to something,\nso be sure not to forget about it.\n\nYou can leave `rcv_drawable_unselected` equal to 0 if you want a\ntransparent background.\n\nIn your Java (or other JVM-compatible language) file, get a reference\nto the view and set it up with a ViewPager.\n\n```\nViewPager pager;\npager.setAdapter(adapter);\n\n\n// Activity\nCutoutViewIndicator cvi = (CutoutViewIndicator) findViewById(R.id.indicator);\ncvi.setViewPager(pager);\n...\n// Fragment\nCutoutViewIndicator cvi = (CutoutViewIndicator) view.findViewById(R.id.indicator);\ncvi.setViewPager(pager);\n...\n// DataBinding\nCutoutViewIndicator cvi = binding.indicator;\ncvi.setViewPager(pager);\n```\n\nThen you're good to go. When you're done with the view, it's probably a\ngood idea to de-initialise the CutoutViewIndicator.\n\n```\ncvi.setViewPager(null);\n```\n\nIf you want to use something other than simple ImageViews, you can\nset your own Generator on the object.\n\n```\ncvi.setGenerator(new GifGenerator());\n```\n\n`ImageCellGenerator` is designed for extensibility - consider\nsubclassing your custom Generator from that if its views extend\nImageView.\n\nThe base library also ships with an experimental CutoutCellGenerator\ncalled `TextCellGenerator`. Check out the javadoc for details on how\nto work with it.\n\nLicense\n-------\n\n    Copyright 2016-2019 Philip Cohn-Cort and Fuzz Productions\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\nCaveats\n-------\n\nRight now it only supports Android SDK 14 and up\n(that makes it compatible with Ice Cream Sandwich, Jelly Bean, Lollipop,\nMarshmallow, and Nougat), but there's little stopping it from being\nbackported all the way to APIv11.\n\nGrab a copy of the demo application (live apk coming soon) to try\nit in action.\n\nCredit:\n-------\n\nThis project was inspired by the work of others in the Android community,\nespecially [ViewPagerIndicator][5] and [AvatarImageView][6].\n\n\n [1]: https://developer.android.com/reference/android/support/v4/view/ViewPager.html\n [2]: https://github.com/eccyan/SpinningTabStrip\n [3]: indicator/src/main/java/com/fuzz/indicator/CutoutViewIndicator.java#L593\n [4]: mobile/src/main/java/com/fuzz/emptyhusk/prefab/RecyclerStateProxy.java\n [5]: https://github.com/JakeWharton/ViewPagerIndicator\n [6]: https://github.com/fanrunqi/AvatarImageView\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fml-opensource%2Fcutoutviewindicator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fml-opensource%2Fcutoutviewindicator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fml-opensource%2Fcutoutviewindicator/lists"}