Posts

Showing posts with the label Material-Design

How to Implement Ripple Effect in Android

Image
In this tip, I’m going to show you to implement ripple effect/animation in your android application. Now, you can easily add ripple effect/animation in your android, layouts, buttons, textviews, etc. and you can also change its color. Note that, this ripple effect will only show on device running lollipop and above.   Here, I have mentioned two different methods to implement ripple animation in your android application. Method 1 - To Implement Ripple Effect/Animation in Android To implement effect on press/click just add android:background="?attr/selectableItemBackground" or android:background="?attr/selectableItemBackgroundBorderless" in android View or ViewGroup as background. Method 2: To Implement Ripple Effect/Animation in Android Using this method, you can customize ripple effect color. First, you have to create an xml file in your drawable resource directory. Create a ripple_effect.xml file and add following code....