{"id":13396410,"url":"https://github.com/ChadCSong/ShineButton","last_synced_at":"2025-03-13T23:31:05.493Z","repository":{"id":40545806,"uuid":"62611784","full_name":"ChadCSong/ShineButton","owner":"ChadCSong","description":"This is a UI lib for Android. Effects like shining.","archived":false,"fork":false,"pushed_at":"2022-10-08T07:47:29.000Z","size":2525,"stargazers_count":4221,"open_issues_count":30,"forks_count":544,"subscribers_count":77,"default_branch":"master","last_synced_at":"2024-10-14T18:41:38.230Z","etag":null,"topics":["button","custom","effects"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChadCSong.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":"2016-07-05T06:32:26.000Z","updated_at":"2024-09-28T08:19:38.000Z","dependencies_parsed_at":"2022-07-31T23:38:48.890Z","dependency_job_id":null,"html_url":"https://github.com/ChadCSong/ShineButton","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChadCSong%2FShineButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChadCSong%2FShineButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChadCSong%2FShineButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChadCSong%2FShineButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChadCSong","download_url":"https://codeload.github.com/ChadCSong/ShineButton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221421539,"owners_count":16817824,"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":["button","custom","effects"],"created_at":"2024-07-30T18:00:50.403Z","updated_at":"2024-10-25T11:30:29.758Z","avatar_url":"https://github.com/ChadCSong.png","language":"Java","readme":"# ShineButton\n[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ChadCSong/ShineButton/raw/master/LICENSE)\n[![platform](https://img.shields.io/badge/platform-Android-yellow.svg)](https://www.android.com)\n[![Build Status](https://travis-ci.org/ChadCSong/ShineButton.svg?branch=master)](https://travis-ci.org/ChadCSong/ShineButton)\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-ShineButton-green.svg?style=true)](https://android-arsenal.com/details/1/3846)\n[![API](https://img.shields.io/badge/API-14%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=14)\n\nThis is a UI lib for Android. Effects like shining.\n\n![preview](https://github.com/ChadCSong/ShineButton/blob/master/image/demo_shine_others.gif)\n\n## Usage\n```java\n shineButton = (ShineButton) findViewById(R.id.shine_button);\n shineButton.init(activity);\n```\nor\n\n```java\n ShineButton shineButtonJava = new ShineButton(this);\n shineButtonJava.setBtnColor(Color.GRAY);\n shineButtonJava.setBtnFillColor(Color.RED);\n shineButtonJava.setShapeResource(R.raw.heart);\n shineButtonJava.setAllowRandomColor(true);\n LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(100, 100);\n shineButtonJava.setLayoutParams(layoutParams);\n if (linearLayout != null) {\n     linearLayout.addView(shineButtonJava);\n }\n```\n#### Simple Usage\n\nIcon shape is made from png mask. Please see raw files.\n```shell\napp:siShape\n```\n\nDefault button color.\n```shell\napp:btn_color\n```\nFill button color.\n```shell\napp:btn_fill_color\n```\nIf this property is true,the effects will become random color shine.\n```shell\napp:allow_random_color\n```\n\n![preview](https://github.com/ChadCSong/ShineButton/blob/master/image/demo_small.gif)\n\n```xml\n \u003ccom.sackcentury.shinebuttonlib.ShineButton\n                android:layout_width=\"50dp\"\n                android:layout_height=\"50dp\"\n                android:layout_centerInParent=\"true\"\n                android:src=\"@android:color/darker_gray\"\n                android:id=\"@+id/po_image2\"\n                app:btn_color=\"@android:color/darker_gray\"\n                app:btn_fill_color=\"@android:color/holo_green_dark\"\n                app:allow_random_color=\"false\"\n                app:siShape=\"@raw/smile\"/\u003e\n ```\n#### Complex Usage\n\n\n| Property                 | Java method                          | Description                     |\n| ------------------------ | ------------------------------------ | -------------------------------------------- |\n| siShape                  | void setShapeResource(int)           | Set raw resource (png)                       |\n| btn_color                | void setBtnColor(int)                | Set origin  color                            |\n| btn_fill_color           | void setBtnFillColor(int)            | Set fill color after click                   |\n| allow_random_color       | void setAllowRandomColor(boolean)    | Allow shine color random                     |\n| shine_animation_duration | void setAnimDuration(int)            | Set shine anim duration                      |\n| big_shine_color          | void setBigShineColor(int)           | Set big shine color                          |\n| click_animation_duration | void setClickAnimDuration(int)       | Set click anim duration                      |\n| enable_flashing          | void enableFlashing(boolean)         | Enable effect like flash                     |\n| shine_count              | void setShineCount(int)              | Set shine count around button                |\n| shine_distance_multiple  | void setShineDistanceMultiple(float) | Set multiple of distance to button           |\n| shine_turn_angle         | void setShineTurnAngle(float)        | Set turn angle of shine                      |\n| shine_size               | void setShineSize(int)               | Set size of shine by pixel                   |\n| small_shine_color        | void setSmallShineColor(int)         | Set small shine color                        |\n| small_shine_offset_angle | void setSmallShineOffAngle(float)    | Set angle offset of small shine to big shine |\n\n\n```shell\napp:shine_turn_angle=\"20\"\napp:shine_count=\"15\"\napp:allow_random_color=\"true\"\napp:enable_flashing=\"true\"\n```\n![preview](https://github.com/ChadCSong/ShineButton/blob/master/image/demo_shine_others.gif)\n\n\n ```xml\n \u003ccom.sackcentury.shinebuttonlib.ShineButton\n                 android:layout_width=\"50dp\"\n                 android:layout_height=\"50dp\"\n                 android:layout_centerInParent=\"true\"\n                 android:src=\"@android:color/darker_gray\"\n                 android:id=\"@+id/po_image1\"\n                 app:btn_color=\"@android:color/darker_gray\"\n                 app:btn_fill_color=\"#FF6666\"\n                 app:allow_random_color=\"false\"\n                 app:enable_flashing=\"false\"\n                 app:big_shine_color=\"#FF6666\"\n                 app:click_animation_duration=\"200\"\n                 app:shine_animation_duration=\"1500\"\n                 app:shine_turn_angle=\"10\"\n                 app:small_shine_offset_angle=\"20\"\n                 app:shine_distance_multiple=\"1.5f\"\n                 app:small_shine_color=\"#CC9999\"\n                 app:shine_count=\"8\"\n                 app:siShape=\"@raw/like\"/\u003e\n  ```\n\n### Support Dialog\n\nWhen use button on a Dialog\n\n```java\nshineButton.setFixDialog(dialog);\n\n```\nEasy to support.\n\n## Requirements\n\n- Android 4.0+\n\n## Code Reference\n\n[android-shape-imageview](https://github.com/siyamed/android-shape-imageview)\n[EasingInterpolator](https://github.com/MasayukiSuda/EasingInterpolator)\n\n\n## Maven\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.sackcentury\u003c/groupId\u003e\n  \u003cartifactId\u003eshinebutton\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.0\u003c/version\u003e\n  \u003ctype\u003eaar\u003c/type\u003e\n\u003c/dependency\u003e\n```\n## Gradle\n\n```gradle\nbuildscript {\n    repositories {\n        mavenCentral()\n    }\n}\ndependencies {\n    compile 'com.sackcentury:shinebutton:1.0.0'\n}\n```\n\n##\n\n## Credits\n\niOS lib [fave-button](https://github.com/xhamr/fave-button) Android implement.\nFaveButton was inspired by Twitter’s Like Heart Animation;\n\n## Third Party Bindings\n  \t\t  \n### React Native\nYou may now use this library with [React Native](https://github.com/facebook/react-native) via the module [here](https://github.com/prscX/react-native-shine-button)\n\n\nLicense\n------------\n    The MIT License (MIT)\n    \n    Copyright (c) 2016 Chad Song \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","funding_links":[],"categories":["Index `(light-weight pages)`","点赞按钮","Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChadCSong%2FShineButton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FChadCSong%2FShineButton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChadCSong%2FShineButton/lists"}