{"id":17981459,"url":"https://github.com/andremion/counterfab","last_synced_at":"2025-05-16T16:01:41.671Z","repository":{"id":129053159,"uuid":"78136976","full_name":"andremion/CounterFab","owner":"andremion","description":"A FloatingActionButton subclass that shows a counter badge on right top corner","archived":false,"fork":false,"pushed_at":"2021-04-27T09:40:31.000Z","size":2370,"stargazers_count":728,"open_issues_count":3,"forks_count":112,"subscribers_count":20,"default_branch":"development","last_synced_at":"2025-04-12T14:18:54.992Z","etag":null,"topics":["android","badge","button","counter","counter-badge","fab","floating-action-button","kotlin"],"latest_commit_sha":null,"homepage":"https://play.google.com/store/apps/details?id=com.andremion.counterfab.sample","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/andremion.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}},"created_at":"2017-01-05T18:17:50.000Z","updated_at":"2025-03-16T21:15:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"c68579e0-eb7c-4101-9a41-d51dfff7eff6","html_url":"https://github.com/andremion/CounterFab","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andremion%2FCounterFab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andremion%2FCounterFab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andremion%2FCounterFab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andremion%2FCounterFab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andremion","download_url":"https://codeload.github.com/andremion/CounterFab/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248578876,"owners_count":21127714,"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","badge","button","counter","counter-badge","fab","floating-action-button","kotlin"],"created_at":"2024-10-29T18:09:59.101Z","updated_at":"2025-04-12T14:19:01.370Z","avatar_url":"https://github.com/andremion.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=true)](http://www.apache.org/licenses/LICENSE-2.0)\n![minSdkVersion 16](https://img.shields.io/badge/minSdkVersion-16-red.svg?style=true)\n![compileSdkVersion 24](https://img.shields.io/badge/compileSdkVersion-24-yellow.svg?style=true)\n[![CircleCI](https://circleci.com/gh/andremion/CounterFab.svg?style=svg)](https://circleci.com/gh/andremion/CounterFab)\n[![maven-central](https://img.shields.io/maven-central/v/com.github.andremion/counterfab.svg)](https://search.maven.org/#artifactdetails%7Ccom.github.andremion%7Ccounterfab%7C1.2.2%7Caar)\n\n[![Android Arsenal CounterFab](https://img.shields.io/badge/Android%20Arsenal-CounterFab-green.svg?style=true)](https://android-arsenal.com/details/1/5052)\n[![MaterialUp CounterFab](https://img.shields.io/badge/MaterialUp-CounterFab-blue.svg?style=true)](https://material.uplabs.com/posts/counterfab-library)\n\n![Icon](https://raw.githubusercontent.com/andremion/CounterFab/master/sample/src/main/res/mipmap-hdpi/ic_launcher.png)\n# CounterFab\nA FloatingActionButton subclass that shows a counter badge on right top corner\n\n![Sample](https://raw.githubusercontent.com/andremion/CounterFab/master/art/sample.gif)\n\n[![Get it on Google Play](https://developer.android.com/images/brand/en_generic_rgb_wo_60.png)](https://play.google.com/store/apps/details?id=com.andremion.counterfab.sample)\n\nIt's also used by [Louvre](https://github.com/andremion/Louvre) library.\n\n![Louvre](https://raw.githubusercontent.com/andremion/Louvre/master/art/sample.gif)\n\n## Installation\n\nInclude the library in your `build.gradle` _(check badge at top for latest version)_\n\n```groovy\ndependencies{\n    compile 'com.github.andremion:counterfab:x.y.z'\n}\n```\n\nor in your `pom.xml` if you are using Maven\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.andremion\u003c/groupId\u003e\n  \u003cartifactId\u003ecounterfab\u003c/artifactId\u003e\n  \u003cversion\u003ex.y.z\u003c/version\u003e\n  \u003ctype\u003epom\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\n## Usage\n\nAdd it as a regular FloatingActionButton on layout…\n\n```xml\n\u003ccom.andremion.counterfab.CounterFab\n        android:id=\"@+id/counter_fab\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:src=\"@drawable/ic_add_white_24dp\" /\u003e\n```\n\nand programmatically you can use one of these methods:\n\n```java\nCounterFab counterFab = (CounterFab) findViewById(R.id.counter_fab);\ncounterFab.setCount(10); // Set the count value to show on badge\ncounterFab.increase(); // Increase the current count value by 1\ncounterFab.decrease(); // Decrease the current count value by 1\n```\n\n## Customization\n\nThe recommended way to customize the background color is by using the `app:backgroundTint` attribute\n\n```xml\n\u003ccom.andremion.counterfab.CounterFab\n        android:id=\"@+id/counter_fab\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        app:backgroundTint=\"@color/colorAccent\"\n        android:src=\"@drawable/ic_add_white_24dp\" /\u003e\n```\n\nTo change the badge style you can use these attributes:\n\n- `app:badgeBackgroundColor`\n- `app:badgeTextColor`\n- `app:badgePosition` as `RightTop`, `LeftBottom`, `LeftTop` or `RightBottom`\n\nFor example:\n\n```xml\n\u003ccom.andremion.counterfab.CounterFab\n        android:id=\"@+id/counter_fab\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        app:badgeBackgroundColor=\"@color/red\"\n        app:badgeTextColor=\"@color/white\"\n        app:badgePosition=\"RightTop\"\n        android:src=\"@drawable/ic_add_white_24dp\" /\u003e\n```\n\nSee more at the [sample](https://github.com/andremion/CounterFab/tree/master/sample)\n\n## Libraries and tools used in the project\n\n* [Design Support Library](http://developer.android.com/intl/pt-br/tools/support-library/features.html#design)\nThe Design package provides APIs to support adding material design components and patterns to your apps.\n\n## License\n\n    Copyright 2016 André Mion\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandremion%2Fcounterfab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandremion%2Fcounterfab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandremion%2Fcounterfab/lists"}