Search code examples
androidanimationlayoutripplerippledrawable

Ripple Effect direction issue


When I touch the border of my layout (linear layout with a RippleDrawable as background) the ripple effect does't start in the clicked point but in also the ripple propagates to the center.

RippleDrawable drawable = new RippleDrawable(ColorStateList.valueOf(pressedColor), null, getRippleMask(baseColor)); this.setBackground(drawable);

I also tried to use the setHotspot method using as coordinates (0,0) and it doesn't start in the upper left point.


Solution

  • Solved using the method setHotspotBound(x,y,x,y) before setHotspot(x,y)