{"id":13644776,"url":"https://github.com/ozodrukh/RippleDrawable","last_synced_at":"2025-04-21T10:34:21.670Z","repository":{"id":20846697,"uuid":"24133163","full_name":"ozodrukh/RippleDrawable","owner":"ozodrukh","description":"Ripple effect for Android 14+","archived":false,"fork":false,"pushed_at":"2016-08-08T09:26:52.000Z","size":373,"stargazers_count":516,"open_issues_count":11,"forks_count":89,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-04-05T17:05:47.394Z","etag":null,"topics":["android","android-library","animation","lollipop","ripple"],"latest_commit_sha":null,"homepage":"","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/ozodrukh.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":"2014-09-17T06:40:40.000Z","updated_at":"2025-03-23T00:09:58.000Z","dependencies_parsed_at":"2022-08-25T08:41:22.523Z","dependency_job_id":null,"html_url":"https://github.com/ozodrukh/RippleDrawable","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/ozodrukh%2FRippleDrawable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozodrukh%2FRippleDrawable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozodrukh%2FRippleDrawable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozodrukh%2FRippleDrawable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ozodrukh","download_url":"https://codeload.github.com/ozodrukh/RippleDrawable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250040768,"owners_count":21365159,"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","android-library","animation","lollipop","ripple"],"created_at":"2024-08-02T01:02:13.175Z","updated_at":"2025-04-21T10:34:16.650Z","avatar_url":"https://github.com/ozodrukh.png","language":"Java","funding_links":[],"categories":["MD","Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"readme":"\n*RippleDrawable*\n=============\nPort of Android `\u003cripple\u003e` effect for pre lollipop devices with android 14 + (ICS+)\n\n(well, since NineOldAndroids is deprecated, this library become 14 + only)\n\n### Features\n1. XML inflating\n2. Ripple supports different shapes\n3. Custom drawable loader\n4. Define your custom drawable tags\n\n#### Implementation\n\nCreate your desirable ripple.xml in `drawable/` folder\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cripple\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:color=\"@color/ripple_material_light\"\u003e     \u003c!-- ripple color --\u003e\n\n    \u003c!-- for Floating Action Button --\u003e\n    \u003citem\u003e\n        \u003cshape android:shape=\"oval\"\u003e\n            \u003csolid android:color=\"@color/accent_material_dark\"/\u003e\n        \u003c/shape\u003e\n    \u003c/item\u003e\n\n\u003c/ripple\u003e\n\n```\n\nSecondly we need to inflate `RippleDrawable` and intercept `View` touches\nsee `LollipopDrawablesCompat` and `DrawableHotspotTouch` for inflating and interception sequently. Here is sample:\n\n```java\n\npublic class SampleActivity extends AppCompatActivity {\n\n    private FloatingActionButton mActionButton;\n\n      @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_sample);\n        \n        mActionButton = (FloatingActionButton) findViewById(R.id.fab);\n        mActionButton.setBackgroundDrawable(getDrawable2(R.drawable.fab_background));\n        mActionButton.setClickable(true);// if we don't set it true, ripple will not be played\n        mActionButton.setOnTouchListener(\n                new DrawableHotspotTouch((LollipopDrawable) mActionButton.getBackground()));\n    }\n    \n/**\n     * {@link #getDrawable(int)} is already taken by Android API\n     * and method is final, so we need to give another name :(\n     */\n    public Drawable getDrawable2(int id){\n        return LollipopDrawablesCompat.getDrawable(getResources(), id, getTheme());\n    }\n}\n\n```\n\n**Thats it!**\n\n##Dependency\n\nroot build.gradle add a repository \n```groovy\n    repositories {\n        maven {\n            url \"https://jitpack.io\"\n        }\n    }\n```\n\nand in application module just add\n```groovy \n    dependencies {\n            compile 'com.github.ozodrukh:RippleDrawable:2.0.0'\n    }\n```\n\n#### a little bit more\n\nyou can inflate and create your own `Drawable`classes, here is tips \u0026 tricks\n\n1 extend your Drawable from `LollipopDrawable`\n```java\n    public class LayerDrawable extends LollipopDrawable {\n```\n\n2 implement your own inflation\n```java\n    public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Resources.Theme theme);\n```\n3 Register your `LollipopDrawable`\n```java\nstatic {   \n    LollipopDrawablesCompat.registerDrawable(RippleDrawable.class, \"ripple\");\n}\n```\n\n4 inflate it!\n```java\n    LollipopDrawablesCompat.getDrawable(getResources(), R.drawable.custom_drawable, getTheme());\n```\n\nLicense\n--------\n\n    The MIT License (MIT)\n\n    Copyright (c) 2015 Abdullaev Ozodrukh\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\n    all 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\n    THE SOFTWARE.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fozodrukh%2FRippleDrawable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fozodrukh%2FRippleDrawable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fozodrukh%2FRippleDrawable/lists"}