{"id":13396314,"url":"https://github.com/JorgeCastilloPrz/FABProgressCircle","last_synced_at":"2025-03-13T22:32:10.940Z","repository":{"id":33012943,"uuid":"36646658","full_name":"JorgeCastilloPrz/FABProgressCircle","owner":"JorgeCastilloPrz","description":"Material progress circle around any FloatingActionButton. 100% Guidelines.","archived":false,"fork":false,"pushed_at":"2020-04-20T05:26:57.000Z","size":5293,"stargazers_count":1247,"open_issues_count":43,"forks_count":181,"subscribers_count":26,"default_branch":"master","last_synced_at":"2024-07-31T18:17:05.103Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/JorgeCastilloPrz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2015-06-01T08:07:36.000Z","updated_at":"2024-06-28T23:25:49.000Z","dependencies_parsed_at":"2022-09-26T22:10:37.417Z","dependency_job_id":null,"html_url":"https://github.com/JorgeCastilloPrz/FABProgressCircle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JorgeCastilloPrz%2FFABProgressCircle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JorgeCastilloPrz%2FFABProgressCircle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JorgeCastilloPrz%2FFABProgressCircle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JorgeCastilloPrz%2FFABProgressCircle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JorgeCastilloPrz","download_url":"https://codeload.github.com/JorgeCastilloPrz/FABProgressCircle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221417399,"owners_count":16816879,"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":[],"created_at":"2024-07-30T18:00:44.597Z","updated_at":"2024-10-25T10:32:09.874Z","avatar_url":"https://github.com/JorgeCastilloPrz.png","language":"Java","readme":"FABProgressCircle\n-----------------\n[![Build Status](https://travis-ci.org/JorgeCastilloPrz/FABProgressCircle.svg?branch=master)](https://travis-ci.org/JorgeCastilloPrz/FABProgressCircle) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-FABProgressCircle-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/1942)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.jorgecastilloprz/fabprogresscircle/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.jorgecastilloprz/fabprogresscircle)\n\nAndroid library to provide a material progress circle around your FloatingActionButton. This component is **compatible with any existent FAB**.\n\n![Demo Screenshot][1]\n\n![Demo Screenshot2][2]\n\n**Sample app**:\n\n\u003ca href=\"https://play.google.com/store/apps/details?id=com.github.jorgecastilloprz.fabprogresscircle\"\u003e\n  \u003cimg alt=\"Get it on Google Play\"\n       src=\"https://developer.android.com/images/brand/en_generic_rgb_wo_60.png\" /\u003e\n\u003c/a\u003e\n\n[Youtube FABProgressCircle video](http://www.youtube.com/watch?v=sP-Ng7e8k6g)\n \n`FABProgressCircle` follows material guidelines at 100%. Links to Google samples of this behavior:\n\n* [Sample video from Google][material-sample-2]\n\nHow to use\n----------\nYou can use the `FABProgressCircle` to wrap **any existent FAB**. Here you have an example wrapping the **Google** FloatingActionButton from the brand\nnew [Design Support Library][google-design-support].\n```xml\n\u003ccom.github.jorgecastilloprz.FABProgressCircle\n    android:id=\"@+id/fabProgressCircle\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    \u003e\n\n  \u003c!-- You can change it with the fab from the library you want to use --\u003e\n  \u003candroid.support.design.widget.FloatingActionButton\n      android:id=\"@+id/fab\"\n      android:layout_width=\"wrap_content\"\n      android:layout_height=\"wrap_content\"\n      android:src=\"@drawable/ic_upload\"\n      app:rippleColor=\"@color/fab_ripple\"\n      app:elevation=\"@dimen/fab_elevation\"\n      app:borderWidth=\"0dp\"\n      /\u003e\n\n\u003c/com.github.jorgecastilloprz.FABProgressCircle\u003e\n```\nTo show the progress circle, call the `show()` method into the normal click/touch listener of your fab:\n```java\nfabView.setOnClickListener(new View.OnClickListener() {\n  @Override public void onClick(View view) {\n    fabProgressCircle.show();\n    startYourAsynchronousJob();\n  }\n});\n```\nThe progress animation will be indeterminate at the beginning, as you can't really know how long is the asynchronous call going to take to complete.\n\n**IMPORTANT:** The animation will start playing everytime the user clicks on the button. Developers should control the potential spam click in their fab buttons,\nto not allow the users to click on it if the asynchronous task and the progress animation are already running / playing at that very moment. I rather leaving that behavior\nto every dev using this library.\n\nTo play the completion animation, you will need to call:\n```java\nfabProgressCircle.beginFinalAnimation();\n```\nWhen the completion animation is displayed, the fab gets transformed to its final appearance, and **it becomes not clickable** anymore. This behavior is intentional.\nIf you want your fab to get clickable again (to be able to repeat the process), check custom attribute `app:reusable=\"true\"` in the custom attributes list.\nIf something happens to the asynchronous task running (some kind of error), you can always stop the animation by doing:\n```java\nfabProgressCircle.hide();\n```\nFor listening to the completion animation, your class needs to implement the `FABProgressListener` interface:\n```java\nfabProgressCircle.attachListener(this);\n```\nIf you do that, the following method call will be dispatched at the right time. The Snackbar creation is just an example:\n```java\n@Override public void onFABProgressAnimationEnd() {\n    Snackbar.make(fabProgressCircle, R.string.cloud_upload_complete, Snackbar.LENGTH_LONG)\n        .setAction(\"Action\", null)\n        .show();\n}\n```\n\nCustom Attributes\n-----------------\nEven if i want the component to respect material guidelines, you can customize some parameters to adapt it a little bit for your application UI/UX.\nHere they are:\n\n* `app:arcColor=\"@color/progressArcColor\"`: Sets the color for the arc, and for the final aspect of the FAB (after the transform animation).\n* `app:arcWidth=\"@dimen/arcStrokeWidth\"`: Stroke width for the progress circle.\n* `app:finalIcon=\"@drawable/ic_done\"`: By default, this library uses the typical `ic_done` icon at the end of the animation. Normally i would\nrather not to change it, but feel free to do it if you need to.\n* `app:reusable=\"true\"`: By default, the FAB gets locked when the final animation finishes. Use this attr to allow using the FAB multiple times. A new\nfadeout anim will be played after completion, and the component will get reset to it's initial state.\n* `app:circleSize=\"normal\"` or `app:circleSize=\"mini\"`: Normally you will not use this attribute, as the default size for the circle is the normal one.\nBut if you are working with a mini sized FAB, you will need to use it.\n* `app:roundedStroke=\"true\"`: Use this one to have a rounded stroke on both progress circle heads. You will not really notice the difference for the default\n`arcStrokeWidth`, but you will if you are using a higher width to get some cool effects.\n\nOf course, anyone of the custom attrs can be used with resource references (`@dimen`, `@color`, `@integer` ...) or just literal values.\nDont forget to add the namespace declaration to your xml file. You can change the namespace name from `app` to anything you want.\n\n```xml\nxmlns:app=\"http://schemas.android.com/apk/res-auto\"\n```\nCode sample\n```xml\n\u003ccom.github.jorgecastilloprz.FABProgressCircle\n    android:id=\"@+id/fabProgressCircle\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    app:arcColor=\"#00ffff\"\n    app:arcWidth=\"7dp\"\n    app:finalIcon=\"@drawable/ic_bookmark_complete\"\n    \u003e\n\n  \u003candroid.support.design.widget.FloatingActionButton\n      ...\n      /\u003e\n\n\u003c/com.github.jorgecastilloprz.FABProgressCircle\u003e\n```\nRemember that the FAB customization / configuration depends on the FAB library, not on this one. This is just a component used to wrap it visually.\nI created it by this way to make it totally compatible with any fab library you might be using into your app.\n\nMini Size\n---------\nMini size is totally supported, so feel free to use the `app:fabSize=\"mini\"` custom attribute on the Google FAB, or the corresponding `mini` custom\nattribute of the fab library you are using. **IMPORTANT:** You will need to add the custom attribute `app:circleSize=\"mini\"` to the `FABProgressCircle`\nto get this feature working on properly.\n\n![Demo Screenshot3][3]\n\nSupported most used FAB libraries\n---------------------------------\n* [FutureSimple android-floating-action-button][4]\n* [Makovkastar android-floating-action-button][5]\n\nKnown issues\n------------\n* Still not compatible with complex fab modes like the `FloatingActionsMenu` from the [futuresimple library][4]. I will work on that as soon as possible.\n* Not tested for [makovkastar library][5] hidding / showing mode when attached to some `ListView` / `RecyclerView`. But it will pretty much fail (i think).\n\nPull requests to solve the above stated issues will be very welcome.\n\nContributions\n-------------\nFeel free to send `Pull Requests` to this repository if you feel that it lacks some functionality. I will be pleased to accept or discuss about them.\nHowever, **Material Design guidelines will be required**.\n\nAdd it to your project\n----------------------\nIf you are working with gradle, add the dependency to your `build.gradle` file:\n```groovy\ndependencies{\n    compile 'com.github.jorgecastilloprz:fabprogresscircle:1.01@aar'\n}\n```\nif you are working with maven, do it into your `pom.xml`\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.jorgecastilloprz\u003c/groupId\u003e\n    \u003cartifactId\u003efabprogresscircle\u003c/artifactId\u003e\n    \u003cversion\u003e1.01\u003c/version\u003e\n    \u003ctype\u003eaar\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\nDeveloped By\n------------\n* Jorge Castillo Pérez - \u003cjorge.castillo.prz@gmail.com\u003e\n\n\u003ca href=\"https://www.linkedin.com/in/jorgecastilloprz\"\u003e\n  \u003cimg alt=\"Add me to Linkedin\" src=\"https://github.com/JorgeCastilloPrz/EasyMVP/blob/master/art/linkedin.png\" /\u003e\n\u003c/a\u003e\n\nLicense\n-------\n\n    Copyright 2015 Jorge Castillo Pérez\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[material-sample-1]: http://material-design.storage.googleapis.com/publish/material_v_4/material_ext_publish/0B0NGgBg38lWWbTlSaHdQZEMtalk/components-progressactivity-typesofindicators-061101_Circular_Aspirational_xhdpi_002.webm\n[material-sample-2]: http://material-design.storage.googleapis.com/publish/material_v_4/material_ext_publish/0B6Okdz75tqQsa0QwVnd6NVlvWkk/components-progressactivity-typesofindicators-Circular_wFab_xhdpi_003.webm\n[google-design-support]: http://developer.android.com/tools/support-library/features.html#design\n[1]: ./art/fabprogresscircle.gif\n[2]: ./art/fabprogresscircle2.gif\n[3]: ./art/fabprogressmini.gif\n[4]: https://github.com/futuresimple/android-floating-action-button\n[5]: https://github.com/makovkastar/FloatingActionButton","funding_links":[],"categories":["Index `(light-weight pages)`","Java","Index","Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJorgeCastilloPrz%2FFABProgressCircle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJorgeCastilloPrz%2FFABProgressCircle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJorgeCastilloPrz%2FFABProgressCircle/lists"}