1

For Android , I need to implement animated ripple effect when i touch on any element/view. How do i achieve it ?

Kushal
  • 6,695
  • 6
  • 48
  • 72
code
  • 1,989
  • 1
  • 18
  • 41

2 Answers2

1

The ripple is centered on the drawable's hotspot, which is set when the button gets touched. Check out Drawable.setHotspot(float x, float y).

oli
  • 4,774
  • 1
  • 14
  • 11
1

According to the Android Documentation :

Drawable that shows a ripple effect in response to state changes. The anchoring position of the ripple for a given state may be specified by calling setHotspot(float, float) with the corresponding state attribute identifier.

The effect is drawn with center specified with setHotspot() method

Kushal
  • 6,695
  • 6
  • 48
  • 72