I am trying to understand how to implement the \"Ripple Effect - Touch Feedback\" for buttons and other views. I looked at the questions related to Ripple touch effect on SO
Slight addition to above answer: Note that the mask color is not used in any way.
You can do more complicated things with ripple as well. For example, if you wanted a border on your ripple button you can use it like a layer-list.
-
-
Note that the element with id @android:id/mask is only used to show where the ripple effect will stop at. If you wanted it to cover the whole button, you could change the android:shape to be rectangle. You can imagine doing many more interesting things with this as well!
Also make sure to have a backup drawable for devices that aren't 21 yet or the app will crash on old devices.