RippleDrawable

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.

Fields

public static final int RADIUS_AUTO = -1 source

Constructors

public RippleDrawable(ColorStateList color, Drawable content, Drawable mask) source

Methods

public 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 source

a 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) source
public void setRadius(int radius) source
public int getRadius() source
public Rect getDirtyBounds() source
public boolean isStateful() source
public void setHotspot(float x, float y) source
protected boolean onStateChange(int[] state) source
public void draw(Canvas canvas) source
public void setAlpha(int alpha) source
public void setColorFilter(ColorFilter colorFilter) source
public int getOpacity() source

Made 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.