All Projects → ozodrukh → Rippledrawable

ozodrukh / Rippledrawable

Licence: mit
Ripple effect for Android 14+

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Rippledrawable

material-ripple
💧 Material Design Ripple effect with jQuery and CSS
Stars: ✭ 20 (-96.12%)
Mutual labels:  ripple
RippleView
ripple view
Stars: ✭ 118 (-77.09%)
Mutual labels:  ripple
Hgrippleradarview
A beautiful radar view to show nearby items (users, restaurants, ...) with ripple animation, fully customizable
Stars: ✭ 309 (-40%)
Mutual labels:  ripple
react-touch-ripple
Create ripple effect from Material Design with React
Stars: ✭ 27 (-94.76%)
Mutual labels:  ripple
LoadersPack-Android
Android LoadersPack - a replacement of default android material progressbar with different loaders
Stars: ✭ 119 (-76.89%)
Mutual labels:  ripple
crypto-database
Database for crypto data, supporting several exchanges. Can be used for TA, bots, backtest, realtime trading, etc.
Stars: ✭ 72 (-86.02%)
Mutual labels:  ripple
FFF Protocol Core
FFF as a new generation of the underlying chain technology, applying power block chain of innovation and fall to the ground, will help the industry standard. FFF consensus mechanism: the application of a new work-proof mechanism, network contribution proof mechanism, refers to the contribution ability of servers, PC and other devices to improve …
Stars: ✭ 5 (-99.03%)
Mutual labels:  ripple
Ta4j Origins
A Java library for technical analysis ***Not maintained anymore, kept for archival purposes, see #192***
Stars: ✭ 354 (-31.26%)
Mutual labels:  ripple
Ripple.js
Proper Material Design ripple effect for the web, that wouldn't interfere your elements' DOM.
Stars: ✭ 18 (-96.5%)
Mutual labels:  ripple
Coinpricebar
💰 Cryptocurrency prices on MacBook Touch Bar
Stars: ✭ 290 (-43.69%)
Mutual labels:  ripple
TheWorldExchange
A purely client-side wallet and direct interface showcasing the full functionality of Ripple / blockchain.
Stars: ✭ 34 (-93.4%)
Mutual labels:  ripple
Android-Animated-Theme-Manager
create your custom themes and change them dynamically with ripple animation
Stars: ✭ 540 (+4.85%)
Mutual labels:  ripple
explorer
Open Source XRP Ledger Explorer
Stars: ✭ 18 (-96.5%)
Mutual labels:  ripple
xrpl-dev-portal
Source code for xrpl.org including developer documentation
Stars: ✭ 330 (-35.92%)
Mutual labels:  ripple
Pulseview
Widget that generates pulsation relative to your icons. Tinder search like.
Stars: ✭ 315 (-38.83%)
Mutual labels:  ripple
wallet-address-validator
Useful library for validation of Bitcoin, Litecoin, Ethereum and other cryptocoin addresses
Stars: ✭ 240 (-53.4%)
Mutual labels:  ripple
crypto-quotes
100+ Best of Crypto Quotes - I HODL, you HODL, we HODL! - BREAKING: BITCOIN JUST BROKE $22 000!
Stars: ✭ 12 (-97.67%)
Mutual labels:  ripple
Vue Touch Ripple
👆 Touch ripple component for @vuejs
Stars: ✭ 443 (-13.98%)
Mutual labels:  ripple
Css Ripple Effect
Pure CSS (no JavaScript) implementation of Android Material design "ripple" animation
Stars: ✭ 321 (-37.67%)
Mutual labels:  ripple
Vue Ripple Directive
Material Ripple Effect as Vue Directive.
Stars: ✭ 266 (-48.35%)
Mutual labels:  ripple

RippleDrawable

Port of Android <ripple> effect for pre lollipop devices with android 14 + (ICS+)

(well, since NineOldAndroids is deprecated, this library become 14 + only)

Features

  1. XML inflating
  2. Ripple supports different shapes
  3. Custom drawable loader
  4. Define your custom drawable tags

Implementation

Create your desirable ripple.xml in drawable/ folder

<?xml version="1.0" encoding="utf-8"?>
<ripple
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:color="@color/ripple_material_light">     <!-- ripple color -->

    <!-- for Floating Action Button -->
    <item>
        <shape android:shape="oval">
            <solid android:color="@color/accent_material_dark"/>
        </shape>
    </item>

</ripple>

Secondly we need to inflate RippleDrawable and intercept View touches see LollipopDrawablesCompat and DrawableHotspotTouch for inflating and interception sequently. Here is sample:

public class SampleActivity extends AppCompatActivity {

    private FloatingActionButton mActionButton;

      @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sample);
        
        mActionButton = (FloatingActionButton) findViewById(R.id.fab);
        mActionButton.setBackgroundDrawable(getDrawable2(R.drawable.fab_background));
        mActionButton.setClickable(true);// if we don't set it true, ripple will not be played
        mActionButton.setOnTouchListener(
                new DrawableHotspotTouch((LollipopDrawable) mActionButton.getBackground()));
    }
    
/**
     * {@link #getDrawable(int)} is already taken by Android API
     * and method is final, so we need to give another name :(
     */
    public Drawable getDrawable2(int id){
        return LollipopDrawablesCompat.getDrawable(getResources(), id, getTheme());
    }
}

Thats it!

##Dependency

root build.gradle add a repository

    repositories {
        maven {
            url "https://jitpack.io"
        }
    }

and in application module just add

    dependencies {
            compile 'com.github.ozodrukh:RippleDrawable:2.0.0'
    }

a little bit more

you can inflate and create your own Drawableclasses, here is tips & tricks

1 extend your Drawable from LollipopDrawable

    public class LayerDrawable extends LollipopDrawable {

2 implement your own inflation

    public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Resources.Theme theme);

3 Register your LollipopDrawable

static {   
    LollipopDrawablesCompat.registerDrawable(RippleDrawable.class, "ripple");
}

4 inflate it!

    LollipopDrawablesCompat.getDrawable(getResources(), R.drawable.custom_drawable, getTheme());

License

The MIT License (MIT)

Copyright (c) 2015 Abdullaev Ozodrukh

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].