WaveView icon indicating copy to clipboard operation
WaveView copied to clipboard

Smooth leveling on setting level

Open fkucukapps opened this issue 8 years ago • 2 comments

Between setting new levels, the wave level changes immediately. However I want the level to rise and fall gradually. How can I achieve that?

fkucukapps avatar Jan 15 '18 09:01 fkucukapps

private void updateWaveViewWithAnimation(int start, int end, long duration) {
        ValueAnimator valueAnimator = ValueAnimator.ofInt(start, end);
        valueAnimator.setDuration(duration);
        valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                waveView.setProgress((int)valueAnimator.getAnimatedValue());
            }
        });
        valueAnimator.start();
    }

I am using this but it is not really smooth on emulator.

LutfiTekin avatar Jan 16 '18 10:01 LutfiTekin

Unfortunately, in my case it diddn't provide me a solution. Thanks for trying anyways, it's a good approach though 👍

fkucukapps avatar Jan 16 '18 20:01 fkucukapps