how to create ripple effect for pre-lollipop
You could try this library balysv/material-ripple.
In your gradle, add this line :
compile 'com.balysv:material-ripple:1.0.2'
And this is how to do it :
<com.balysv.materialripple.MaterialRippleLayout
android:id="@+id/ripple"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Button inside a ripple"/>
</com.balysv.materialripple.MaterialRippleLayout>
Ripple Effect for pre lollipop
you can use this library by this you can add ripple effect on pre-Lolipop version too.
for example
add button in your layout file
<com.rey.material.widget.Button
style="@style/ButtonRippleStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BUTTON"
app:rd_enable="true"/>
add custom style in your style file
<style name="ButtonRippleStyle" parent="Material.Drawable.Ripple.Wave.Light">
<item name="android:background">@null</item>
<item name="rd_rippleColor">#20F15A2B</item>
</style>
Android ripple effect outside view for pre lollipop
Take a look at these 2 libraries:
https://github.com/skyfishjy/android-ripple-background
https://github.com/ruzhan123/RippleView
android ripple effect crashes in pre-lollipop even when I added drawable-21
in drawable-v21 add your rippledrawable and in drawable add the selector drawable , as <ripple> </ripple>
tags are used for api >=21
Related Topics
How to Fill Color in Image in Particular Area
How to Implement Rounded Corners to a Mapfragment
Pass Parameter with Volley Post
Uploading Image from Android to Gcs
Detecting Gps On/Off Switch in Android Phones
Method to Get All Edittexts in a View
Android Systemui Glitches in Lollipop
No Peer Certificate' Error in Android 2.3 But Not in 4
How to Set Text of Text View in Another Thread
Event for Videoview Playback State or Mediacontroller Play/Pause
Set Unchangeable Some Part of Edittext Android
How to Make Layouts for Several Android Screen Sizes
How to Programmatically Scroll Android Webview