Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Repeat pulse Animation

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> 
like image 312
Skyrisu Avatar asked Dec 04 '14 18:12

Skyrisu


People also ask

What is pulse animation?

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.

How do you use pulse animation in PowerPoint?

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.


1 Answers

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(); 
like image 57
A. Adam Avatar answered Sep 23 '22 13:09

A. Adam