From cf9b8326cecfca3917779c3701aa08eaaad56505 Mon Sep 17 00:00:00 2001 From: Winson Date: Thu, 31 Mar 2016 15:36:07 -0700 Subject: [PATCH] Fixing issue with transition jump due to wrong insets. Bug: 27921362 Change-Id: I4139be85253451a70bedbf3b860fc7d652704b0b --- .../com/android/systemui/recents/RecentsImpl.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java index ec873ec1bdcb1..4dae7460f30ab 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java @@ -584,18 +584,24 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener Rect systemInsets = new Rect(); ssp.getStableInsets(systemInsets); Rect windowRect = ssp.getWindowRect(); + // When docked, the nav bar insets are consumed and the activity is measured without insets. + // However, the window bounds include the insets, so we need to subtract them here to make + // them identical. + if (ssp.hasDockedTask()) { + windowRect.bottom -= systemInsets.bottom; + systemInsets.bottom = 0; + } calculateWindowStableInsets(systemInsets, windowRect); windowRect.offsetTo(0, 0); TaskStackLayoutAlgorithm stackLayout = mDummyStackView.getStackAlgorithm(); - stackLayout.getTaskStackBounds(windowRect, systemInsets.top, systemInsets.right, - mTaskStackBounds); // Rebind the header bar and draw it for the transition - Rect taskStackBounds = new Rect(mTaskStackBounds); stackLayout.setSystemInsets(systemInsets); if (stack != null) { - stackLayout.initialize(windowRect, taskStackBounds, + stackLayout.getTaskStackBounds(windowRect, systemInsets.top, systemInsets.right, + mTaskStackBounds); + stackLayout.initialize(windowRect, mTaskStackBounds, TaskStackLayoutAlgorithm.StackState.getStackStateForStack(stack)); mDummyStackView.setTasks(stack, false /* allowNotifyStackChanges */); }