diff --git a/library/src/main/java/com/balysv/materialripple/MaterialRippleLayout.java b/library/src/main/java/com/balysv/materialripple/MaterialRippleLayout.java index 6e77985..bee4181 100644 --- a/library/src/main/java/com/balysv/materialripple/MaterialRippleLayout.java +++ b/library/src/main/java/com/balysv/materialripple/MaterialRippleLayout.java @@ -574,6 +574,16 @@ public void setDefaultRippleAlpha(int alpha) { invalidate(); } + public void performRipple() { + currentCoords = new Point(getWidth() / 2, getHeight() / 2); + startRipple(null); + } + + public void performRipple(Point anchor) { + currentCoords = new Point(anchor.x, anchor.y); + startRipple(null); + } + /** * {@link Canvas#clipPath(Path)} is not supported in hardware accelerated layers * before API 18. Use software layer instead