Thank you for creating VoiceRipple library.
Google Keep's audio recording dialog, as a nice ripple effect around the recording button, when you perform voice recording.
https://i.stack.imgur.com/032Ly.png
I was wondering, what is the right way to implement such elegant ripple effect.
When I test run the demo, I found it isn't as smooth, and as elegant as Google Keep's
The technique, which the library is using, is doing a 50ms delayed busy looping call - https://github.com/wotomas/VoiceRipple/blob/master/ripplelibrary/src/main/java/info/kimjihyok/ripplelibrary/VoiceRippleView.java#L334
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
}
}
};
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.
Do you have any idea, what is a proper way, to achieve such elegant ripple effect?
Thank you for creating VoiceRipple library.
Google Keep's audio recording dialog, as a nice ripple effect around the recording button, when you perform voice recording.
https://i.stack.imgur.com/032Ly.png
I was wondering, what is the right way to implement such elegant ripple effect.
When I test run the demo, I found it isn't as smooth, and as elegant as Google Keep's
The technique, which the library is using, is doing a 50ms delayed busy looping call - https://github.com/wotomas/VoiceRipple/blob/master/ripplelibrary/src/main/java/info/kimjihyok/ripplelibrary/VoiceRippleView.java#L334
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.
Do you have any idea, what is a proper way, to achieve such elegant ripple effect?