Spotlight icon indicating copy to clipboard operation
Spotlight copied to clipboard

Ripple Effect

Open harshkanjariya opened this issue 3 years ago • 1 comments

ripple effect not working i have tried many times but not showing any animation.

harshkanjariya avatar Dec 16 '20 05:12 harshkanjariya

The order of the drawing is wrong in onDraw of SpotlightView, you have to flip the shape and effect draw like this:

if (currentTarget != null && currentShapeAnimator != null) {
      currentTarget.shape.draw(
          canvas = canvas,
          point = currentTarget.anchor,
          value = currentShapeAnimator.animatedValue as Float,
          paint = shapePaint
      )
    }

    if (currentTarget != null && currentEffectAnimator != null && currentShapeAnimator != null && !currentShapeAnimator.isRunning) {
      currentTarget.effect.draw(
          canvas = canvas,
          point = currentTarget.anchor,
          value = currentEffectAnimator.animatedValue as Float,
          paint = effectPaint
      )
    }

cmy82 avatar May 06 '22 00:05 cmy82