I'm trying to create a Infinite pulsing effect in a ImageView. But how is it possible to keep the offset?
<set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false"> <scale android:duration="700" android:fromXScale="1" android:fromYScale="1" android:pivotX="50%" android:pivotY="50%" android:toXScale="0.5" android:toYScale="0.5"/> <scale android:duration="700" android:fromXScale="1" android:fromYScale="1" android:pivotX="50%" android:pivotY="50%" android:startOffset="700" android:toXScale="2" android:toYScale="2"/> </set>
CSS Pulse Animation Effect provides a pulsating effect to an element that changes its shape and opacity. As per the time and need, different @keyframes are used to achieve this animation. The simple yet powerful effect makes the website more vibrant, colorful, and attractive.
To apply it, do the following: Select the arrow. Click the Animations tab and click the gallery's More button (the down triangle at the gallery's right border). In the Emphasis section, click Pulse.
This will make your (Image)View pulsate up to 1.2 its size and back, repeatedly.
ImageView iv = (ImageView) findViewById(R.id.my_imageview); ObjectAnimator scaleDown = ObjectAnimator.ofPropertyValuesHolder( iv, PropertyValuesHolder.ofFloat("scaleX", 1.2f), PropertyValuesHolder.ofFloat("scaleY", 1.2f)); scaleDown.setDuration(310); scaleDown.setRepeatCount(ObjectAnimator.INFINITE); scaleDown.setRepeatMode(ObjectAnimator.REVERSE); scaleDown.start();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With