Material Ripple Layout
Ripple effect wrapper for Android Views.
Including in your project
compile 'com.balysv:material-ripple:1.0.2'
Check for latest version number on the widget below or visit Releases
Usage
Use static initializer on your View
(see xml
attributes below for customization)
Or wrap your View
with MaterialRippleLayout
in your layout file:
If using in an AdapterView
you must set rippleInAdapter
to true
Configure using xml attributes or setters in code:
Set an OnClickListener
to MaterialRippleLayout
:
Or if using in an AdapterView
, simply use OnItemClickListener
Support for Android api versions < 14
For those unlucky developers that need to support older versions than 14, there's a way to do it.
You can use this library in addition with Jake Wharton's animation backport (http://nineoldandroids.com/) changing the imports from import android.animation.*;
to: import com.nineoldandroids.animation.*;
,
import android.util.Property
; to import com.nineoldandroids.util.Property;
and in MaterialRippleLayout.java file, calling function shouldDelayChildPressedState()
only if you're using api greater than 14.
Developed By
Balys Valentukevicius