Any idea how to create an elegant ripple effect for audio recording button - as in Google Keep

33
February 12, 2019, at 03:10 AM

Google Keep's audio recording dialog, as a nice ripple effect around the recording button, when you perform voice recording.

I was wondering, what is the right way to implement such elegant ripple effect.

The closest info I can found is : https://github.com/wotomas/VoiceRipple

However, 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?

READ ALSO
How to run emulator64-arm in a Docker container?

How to run emulator64-arm in a Docker container?

I tried to run emulator64-arm in a Docker container but it reported:

54
How to fix “Package not in whitelist” when binding a Service?

How to fix “Package not in whitelist” when binding a Service?

I have created two different Android applicationsOne contains a Service and the other one the Activity which binds the Service

18
React Native expo push notification with firebase not working?

React Native expo push notification with firebase not working?

I am using expo with firebase as a database and I want push notification I have tried the following thing but did not get successful to push notification for both Android and IOS

30
Hello please I'm trying to create an android chatbot for autoresponse to users input

Hello please I'm trying to create an android chatbot for autoresponse to users input

![It is pretty much static right nowas I could only achieve click an display instead of type an autoresponse] It is pretty much static right now

20