Bounce animation for missed calls

This commit is contained in:
Sylvain Berfini 2012-07-13 14:19:57 +02:00
parent e48c06e677
commit a8928e6858
2 changed files with 14 additions and 0 deletions

11
res/anim/bounce.xml Normal file
View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" android:interpolator="@android:anim/bounce_interpolator">
<translate
android:fromXDelta="0%" android:toXDelta="0%"
android:fromYDelta="40%" android:toYDelta="00%"
android:duration="1000"
android:interpolator="@android:anim/bounce_interpolator"
android:repeatMode="restart"
android:repeatCount="infinite"/>
</set>

View file

@ -57,6 +57,7 @@ import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView;
@ -440,7 +441,9 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
if (missedCallsCount > 0) {
missedCalls.setText(missedCallsCount + "");
missedCalls.setVisibility(View.VISIBLE);
missedCalls.startAnimation(AnimationUtils.loadAnimation(LinphoneActivity.this, R.anim.bounce));
} else {
missedCalls.clearAnimation();
missedCalls.setVisibility(View.GONE);
}
}