diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java index 0c7703663810c..012accda7b844 100644 --- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java +++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java @@ -725,14 +725,21 @@ public class DividerView extends FrameLayout implements OnTouchListener, mMinimizedSnapAlgorithm = null; mDockedStackMinimized = minimized; initializeSnapAlgorithm(); - if (!mIsInMinimizeInteraction && minimized) { - mIsInMinimizeInteraction = true; - mDividerPositionBeforeMinimized = DockedDividerUtils.calculateMiddlePosition( - isHorizontalDivision(), mStableInsets, mDisplayWidth, mDisplayHeight, - mDividerSize); + if (mIsInMinimizeInteraction != minimized) { + if (minimized) { + mIsInMinimizeInteraction = true; + mDividerPositionBeforeMinimized = DockedDividerUtils.calculateMiddlePosition( + isHorizontalDivision(), mStableInsets, mDisplayWidth, mDisplayHeight, + mDividerSize); - int position = mMinimizedSnapAlgorithm.getMiddleTarget().position; - resizeStack(position, position, mMinimizedSnapAlgorithm.getMiddleTarget()); + int position = mMinimizedSnapAlgorithm.getMiddleTarget().position; + resizeStack(position, position, mMinimizedSnapAlgorithm.getMiddleTarget()); + } else { + resizeStack(mDividerPositionBeforeMinimized, mDividerPositionBeforeMinimized, + mSnapAlgorithm.calculateNonDismissingSnapTarget( + mDividerPositionBeforeMinimized)); + mIsInMinimizeInteraction = false; + } } } }