diff options
author | Yorke Lee <yorkelee@google.com> | 2013-07-31 11:47:31 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2013-07-31 11:48:29 -0700 |
commit | 11a9968c65835512ae9b79b9c029042b9a304ebf (patch) | |
tree | 19c1c353615436a367f0217e36955b814efb1caf | |
parent | bd47db14b534c2486632f1f61d36e3af6230b836 (diff) |
Prevent animation length from going negative
Change-Id: I5797dc24a0d4eff96a89627a5b61e7ed16f62dd5
-rw-r--r-- | src/com/android/dialer/list/PhoneFavoriteTileView.java | 1 |
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, |