{"id":13989469,"url":"https://github.com/IvBaranov/MaterialFavoriteButton","last_synced_at":"2025-07-22T11:30:28.729Z","repository":{"id":41128679,"uuid":"43554270","full_name":"IvBaranov/MaterialFavoriteButton","owner":"IvBaranov","description":"Animated favorite/star/like button","archived":false,"fork":false,"pushed_at":"2018-09-05T14:04:15.000Z","size":777,"stargazers_count":586,"open_issues_count":3,"forks_count":92,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-11-29T08:39:09.920Z","etag":null,"topics":["android-ui","animation","button","favorite","material","material-design","material-ui"],"latest_commit_sha":null,"homepage":"","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/IvBaranov.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}},"created_at":"2015-10-02T13:29:14.000Z","updated_at":"2024-11-28T15:36:33.000Z","dependencies_parsed_at":"2022-09-08T05:20:55.232Z","dependency_job_id":null,"html_url":"https://github.com/IvBaranov/MaterialFavoriteButton","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/IvBaranov/MaterialFavoriteButton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvBaranov%2FMaterialFavoriteButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvBaranov%2FMaterialFavoriteButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvBaranov%2FMaterialFavoriteButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvBaranov%2FMaterialFavoriteButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IvBaranov","download_url":"https://codeload.github.com/IvBaranov/MaterialFavoriteButton/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvBaranov%2FMaterialFavoriteButton/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266483408,"owners_count":23936333,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-ui","animation","button","favorite","material","material-design","material-ui"],"created_at":"2024-08-09T13:01:40.585Z","updated_at":"2025-07-22T11:30:28.326Z","avatar_url":"https://github.com/IvBaranov.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"Material Favorite Button\n========================\n\nMaterial spinning favorite/star/like button.\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Material%20Favorite%20Button-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/2612) [![Build Status](https://travis-ci.org/IvBaranov/MaterialFavoriteButton.svg)](https://travis-ci.org/IvBaranov/MaterialFavoriteButton)\n\n![Demo Image][1]\n\nDownload\n--------\n\n```groovy\ncompile 'com.github.ivbaranov:materialfavoritebutton:0.1.5'\n```\n\n\nUsage\n-----\n\nDeclare in XML (see xml attributes below for customization):\n\n```xml\n\u003ccom.github.ivbaranov.mfb.MaterialFavoriteButton\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\" /\u003e\n```\n\nOr static initializer (see xml attributes below for customization):\n\n```java\nMaterialFavoriteButton favorite = new MaterialFavoriteButton.Builder(this)\n        .create();\n```\n\n\n\nConfigure using xml attributes or setters in code:\n\n```java\napp:mfb_state=\"false\"                            // default button state\napp:mfb_animate_favorite=\"true\"                  // to animate favoriting\napp:mfb_animate_unfavorite=\"false\"               // to animate unfavoriting\napp:mfb_padding=\"12\"                             // image padding\napp:mfb_favorite_image=\"@drawable/ic_fav\"        // custom favorite resource\napp:mfb_not_favorite_image=\"@drawable/ic_not_fav\"// custom not favorite resource\napp:mfb_rotation_duration=\"400\"                  // rotation duration\napp:mfb_rotation_angle=\"360\"                     // rotation angle\napp:mfb_bounce_duration=\"300\"                    // bounce duration\napp:mfb_color=\"black\"                            // black or white default resources (enum)\napp:mfb_type=\"star\"                              // star or heart shapes (enum)\napp:mfb_size=\"48\"                                // button size\n```\nMake sure:\n - you are using either (`mfb_favorite_image` and `mfb_not_favorite_image`) or (`mfb_color` and `mfb_type`).\n - if you change `mfb_size` attribute you should also provide your own combination of `mfb_favorite_image` and `mfb_favorite_image` resources and `mfb_padding` attribute that will fit your new dimensions, otherwise you can get blurred icon\n\n\nSet an `OnFavoriteChangeListener` to `MaterialFavoriteButton`:\n\n```java\nfavorite.setOnFavoriteChangeListener(\n        new MaterialFavoriteButton.OnFavoriteChangeListener() {\n          @Override\n          public void onFavoriteChanged(MaterialFavoriteButton buttonView, boolean favorite) {\n          \t//\n          }\n        });\n```\n\nSet an `OnFavoriteAnimationEndListener` to `MaterialFavoriteButton`:\n\n```java\nfavorite.setOnFavoriteAnimationEndListener(\n        new MaterialFavoriteButton.OnFavoriteAnimationEndListener() {\n          @Override\n          public void onAnimationEnd(MaterialFavoriteButton buttonView, boolean favorite) {\n            //\n          }\n        });\n```\n\n##### Usage in RecyclerView\nTo avoid triggering animation while re-rendering item view make sure you set favorite button state in `onBindViewHolder` without animation:\n\n```java\nfavoriteButton.setFavorite(isFavorite(data.get(position)));\n```\n\n\nDeveloped By\n------------\nIvan Baranov\n\nLicense\n-------\n\n```\nCopyright 2015 Ivan Baranov\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\n[1]: https://cloud.githubusercontent.com/assets/6000572/10363036/ad97cfae-6dba-11e5-980a-1f5d82afd773.gif\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIvBaranov%2FMaterialFavoriteButton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIvBaranov%2FMaterialFavoriteButton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIvBaranov%2FMaterialFavoriteButton/lists"}