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);