Class of android.graphics.drawable · RippleDrawable.java · Android's reference
public class RippleDrawable extends LayerDrawable
RippleDrawable ← LayerDrawable ← Drawable
A touch feedback (Abstract in docs/platforms/android-apps/interfaces.md): while the state is pressed, focused or hovered, a circle of the ripple's color around the hotspot, over the content. Android animates the ripple in and out; this draws its final frame, so the app sees the same states and invalidations without the animation.
As on Android it is a LayerDrawable: the content is its first layer, and the mask a layer whose id is android.R.id.mask, which bounds the ripple and is not drawn itself.
public static final int RADIUS_AUTO = -1 sourcepublic RippleDrawable(ColorStateList color, Drawable content, Drawable mask) sourcepublic void inflate(android.content.res.Resources r, org.xmlpull.v1.XmlPullParser parser, android.util.AttributeSet attrs, android.content.res.Resources.Theme theme) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException sourcea ripple: its color and radius, and its items as a layer list's (the mask the one with android:id/mask)
public void setColor(ColorStateList color) sourcepublic void setRadius(int radius) sourcepublic int getRadius() sourcepublic Rect getDirtyBounds() sourcepublic boolean isStateful() sourcepublic void setHotspot(float x, float y) sourceprotected boolean onStateChange(int[] state) sourcepublic void draw(Canvas canvas) sourcepublic void setAlpha(int alpha) sourcepublic void setColorFilter(ColorFilter colorFilter) sourcepublic int getOpacity() sourceMade from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.