From e525a35704043205ac5131898cc3291407864c32 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Fri, 27 May 2016 16:56:55 -0700 Subject: [PATCH] Fix multi-window enter animation Stable insets are not calculated in the first pass, so fetch it manually if needed to avoid a relayout. Bug: 28705801 Change-Id: I8f9a3bab96b597a80963d7ebcc8b19454b3e45a6 --- .../com/android/systemui/stackdivider/DividerView.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java index d09587bbd3e40..998f50f205d7f 100644 --- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java +++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java @@ -1064,6 +1064,14 @@ public class DividerView extends FrameLayout implements OnTouchListener, int position = DockedDividerUtils.calculatePositionForBounds(event.initialRect, mDockSide, mDividerSize); mEntranceAnimationRunning = true; + + // Insets might not have been fetched yet, so fetch manually if needed. + if (mStableInsets.isEmpty()) { + SystemServicesProxy.getInstance(mContext).getStableInsets(mStableInsets); + mSnapAlgorithm = null; + initializeSnapAlgorithm(); + } + resizeStack(position, mSnapAlgorithm.getMiddleTarget().position, mSnapAlgorithm.getMiddleTarget()); }