@Override
    public void draw(Canvas canvas, Paint paint) {
        final float scale = mCurrentScale;
        if (scale > 0) {
            Rect bounds = getBounds();

            float radius = (Math.min(bounds.width(), bounds.height()) / 2.0f);
            float x = bounds.centerX();
            float y = bounds.centerY();

            // Background
            if (scale != 1f && mBackgroundAlpha > 0) {
                paint.setAlpha(mBackgroundAlpha);
                canvas.drawCircle(x, y, radius, paint);
            }

            // Ripple
            if (mRippleAlpha > 0) {
                paint.setAlpha(mRippleAlpha);
                canvas.drawCircle(x, y, radius * scale, paint);
            }
        }
    }
This is a touch foreground ripple drawable extends to StatePaintDrawable
caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/AlmostRippleDrawable.java