diff options
| author | 2016-10-06 21:14:14 +0000 | |
|---|---|---|
| committer | 2016-10-06 21:14:14 +0000 | |
| commit | f9ea846482fb94e05f4090b73eb5b49ae73d29a0 (patch) | |
| tree | 0ce69a1e02323e22c2d05eaf60add8137eec8159 | |
| parent | 35bf3b9ab8afb38dc0dc8415f1dd6a9671c5ceed (diff) | |
| parent | a4a4763f5857ed39d6e4dae263ee9dc01eec756a (diff) | |
Recents TV: Do not allow negative delay
am: a4a4763f58
Change-Id: I7146115b4f9e07c5574127909509d66db9cfab05
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/recents/tv/animations/HomeRecentsEnterExitAnimationHolder.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/tv/animations/HomeRecentsEnterExitAnimationHolder.java b/packages/SystemUI/src/com/android/systemui/recents/tv/animations/HomeRecentsEnterExitAnimationHolder.java index 9faaa4bdccb6..a673c8c67696 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/tv/animations/HomeRecentsEnterExitAnimationHolder.java +++ b/packages/SystemUI/src/com/android/systemui/recents/tv/animations/HomeRecentsEnterExitAnimationHolder.java @@ -47,12 +47,13 @@ public class HomeRecentsEnterExitAnimationHolder { public void startEnterAnimation(boolean isPipShown) { for(int i = 0; i < mGridView.getChildCount(); i++) { TaskCardView view = (TaskCardView) mGridView.getChildAt(i); + long delay = Math.max(mDelay * i, 0); view.setTranslationX(-mTranslationX); view.animate() .alpha(isPipShown ? mDimAlpha : 1.0f) .translationX(0) .setDuration(mDuration) - .setStartDelay(mDelay * i) + .setStartDelay(delay) .setInterpolator(Interpolators.FAST_OUT_SLOW_IN); } } @@ -60,11 +61,12 @@ public class HomeRecentsEnterExitAnimationHolder { public void startExitAnimation(DismissRecentsToHomeAnimationStarted dismissEvent) { for(int i = mGridView.getChildCount() - 1; i >= 0; i--) { TaskCardView view = (TaskCardView) mGridView.getChildAt(i); + long delay = Math.max(mDelay * (mGridView.getChildCount() - 1 - i), 0); view.animate() .alpha(0.0f) .translationXBy(-mTranslationX) .setDuration(mDuration) - .setStartDelay(mDelay * (mGridView.getChildCount() - 1 - i)) + .setStartDelay(delay) .setInterpolator(Interpolators.FAST_OUT_SLOW_IN); if(i == 0) { view.animate().setListener(dismissEvent.getAnimationTrigger() |