From 0e0d85c23c4174a66a04336d5294cfd9231c819a Mon Sep 17 00:00:00 2001 From: Winson Date: Thu, 3 Dec 2015 11:35:25 -0800 Subject: [PATCH] Fixing regression when animating in new views after dismissing task. - In the old stack, the range of stack task progress was 0..1, but now it needs to be offset by the stack range. Change-Id: I21cb5c7c8c3cc3648867626a516de9ab01e704c8 --- .../systemui/recents/views/TaskStackLayoutAlgorithm.java | 9 +++++++++ .../android/systemui/recents/views/TaskStackView.java | 5 +++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java index 6dc380c56a3e3..5c906a62dc900 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java @@ -504,6 +504,15 @@ public class TaskStackLayoutAlgorithm { return 0f; } + /** + * Returns the task progress that would put the task just off the front of the stack. + */ + public float getStackFrontTaskProgress(float stackScroll) { + float max = mUnfocusedRange.relativeMax + + mFocusState * (mFocusedRange.relativeMax - mUnfocusedRange.relativeMax); + return stackScroll + max; + } + /** * Computes the maximum number of visible tasks and thumbnails when the scroll is at the initial * stack scroll. Requires that update() is called first. diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java index d45fba2942e26..f0d5eabc5f5d0 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java @@ -517,8 +517,9 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal } else { if (!hasStackFrontTransform) { hasStackFrontTransform = true; - mLayoutAlgorithm.getStackTransform(1f, 0f, mTmpStackFrontTransform, - null); + mLayoutAlgorithm.getStackTransform( + mLayoutAlgorithm.getStackFrontTaskProgress(0f), 0f, + mTmpStackFrontTransform, null); } tv.updateViewPropertiesToTaskTransform(mTmpStackFrontTransform, 0, 0, mFastOutSlowInInterpolator, mRequestUpdateClippingListener);