title: Any idea how to create an elegant ripple effect for audio recording button - as in Google Keep
body: <p>Google Keep's audio recording dialog, as a nice ripple effect around the recording button, when you perform voice recording.</p>
  
  <p><a href="https://i.stack.imgur.com/032Ly.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/032Ly.png" alt="enter image description here"></a></p>
  
  <p>I was wondering, what is the right way to implement such elegant ripple effect.</p>
  
  <p>The closest info I can found is : <a href="https://github.com/wotomas/VoiceRipple" rel="nofollow noreferrer">https://github.com/wotomas/VoiceRipple</a></p>
  
  <p>However, when I test run the demo, I found it isn't as smooth, and as elegant as Google Keep's</p>
  
  <p>The technique, which the library is using, is doing a 50ms delayed busy looping call - <a href="https://github.com/wotomas/VoiceRipple/blob/master/ripplelibrary/src/main/java/info/kimjihyok/ripplelibrary/VoiceRippleView.java#L334" rel="nofollow noreferrer">https://github.com/wotomas/VoiceRipple/blob/master/ripplelibrary/src/main/java/info/kimjihyok/ripplelibrary/VoiceRippleView.java#L334</a></p>
  
  <pre><code>private Runnable updateRipple = new Runnable() {
      @Override
      public void run() {
          if (isRecording) {
              drop(recorder.getMaxAmplitude());
              currentRecordedTime = currentRecordedTime + 50;
              if (currentRenderer instanceof TimerCircleRippleRenderer) {
                  ((TimerCircleRippleRenderer)currentRenderer).setCurrentTimeMilliseconds(currentRecordedTime);
              }
              handler.postDelayed(this, 50);  // updates the visualizer every 50 milliseconds
          }
      }
  };
  </code></pre>
  
  <p>That doesn't sound like an optimal solution to me. Not only the effect is not elegant, it consumes a lot of battery/cpu resource.</p>
  
  <p>Do you have any idea, what is a proper way, to achieve such elegant ripple effect?</p>