From 11a9968c65835512ae9b79b9c029042b9a304ebf Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Wed, 31 Jul 2013 11:47:31 -0700 Subject: Prevent animation length from going negative Change-Id: I5797dc24a0d4eff96a89627a5b61e7ed16f62dd5 --- src/com/android/dialer/list/PhoneFavoriteTileView.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/com/android') 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, -- cgit v1.2.3