summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-07-31 11:47:31 -0700
committerYorke Lee <yorkelee@google.com>2013-07-31 11:48:29 -0700
commit11a9968c65835512ae9b79b9c029042b9a304ebf (patch)
tree19c1c353615436a367f0217e36955b814efb1caf
parentbd47db14b534c2486632f1f61d36e3af6230b836 (diff)
Prevent animation length from going negative
Change-Id: I5797dc24a0d4eff96a89627a5b61e7ed16f62dd5
-rw-r--r--src/com/android/dialer/list/PhoneFavoriteTileView.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/com/android/dialer/list/PhoneFavoriteTileView.java b/src/com/android/dialer/list/PhoneFavoriteTileView.java
index 9a1577a27..4efc4dbb9 100644
--- a/src/com/android/dialer/list/PhoneFavoriteTileView.java
+++ b/src/com/android/dialer/list/PhoneFavoriteTileView.java
@@ -135,6 +135,7 @@ public abstract class PhoneFavoriteTileView extends ContactTileView {
// favorite removal view to the foreground to ask user to confirm removal.
int animationLength = (int) ((1 - Math.abs(mFavoriteContactCard.getTranslationX()) /
getWidth()) * ANIMATION_LENGTH);
+ animationLength = Math.max(0, animationLength);
final ObjectAnimator fadeOut = ObjectAnimator.ofFloat(mFavoriteContactCard, "alpha",
0.f).setDuration(animationLength);
final ObjectAnimator moveAway = ObjectAnimator.ofFloat(mFavoriteContactCard,