I am currently working with a voice recognition application, and I want my play / pause button to “pulse” when recording. Something like that:

I tried to make ScaleAnimation by making a button, but, of course, it creates all the buttons.
public static ObjectAnimator pulseAnimation(ImageView target){
ObjectAnimator scaleDown = ObjectAnimator.ofPropertyValuesHolder(target,
PropertyValuesHolder.ofFloat("scaleX", 1.1f),
PropertyValuesHolder.ofFloat("scaleY", 1.1f));
scaleDown.setDuration(310);
scaleDown.setRepeatCount(ObjectAnimator.INFINITE);
scaleDown.setRepeatMode(ObjectAnimator.REVERSE);
return scaleDown;
}
So, the idea has achieved something similar, but only with alpha behind the actual button. I want to know if this can be done with alpha animation or something before adding a second “Alpha button” behind my button so that it starts to grow and achieve this effect.
Thank you so much in advance!
source
share