mMinimizedSnapAlgorithm = null;
mDockedStackMinimized = minimized;
initializeSnapAlgorithm();
- if (!mIsInMinimizeInteraction && minimized) {
- mIsInMinimizeInteraction = true;
- mDividerPositionBeforeMinimized = DockedDividerUtils.calculateMiddlePosition(
- isHorizontalDivision(), mStableInsets, mDisplayWidth, mDisplayHeight,
- mDividerSize);
-
- int position = mMinimizedSnapAlgorithm.getMiddleTarget().position;
- resizeStack(position, position, mMinimizedSnapAlgorithm.getMiddleTarget());
+ 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());
+ } else {
+ resizeStack(mDividerPositionBeforeMinimized, mDividerPositionBeforeMinimized,
+ mSnapAlgorithm.calculateNonDismissingSnapTarget(
+ mDividerPositionBeforeMinimized));
+ mIsInMinimizeInteraction = false;
+ }
}
}
}