From f9989e2304ed33cdcac531cb200cb770fca809b4 Mon Sep 17 00:00:00 2001 From: Matthew Ng Date: Mon, 24 Apr 2017 17:14:14 -0700 Subject: [PATCH] Fixes divider position after minimizing and unminimizing with ime open Minimizing with the ime would cause visual glitches with the divider and unminiming after would set the wrong position leaving graphical errors. Record the position before minimizing when adjusting for ime and do not set that position when the ime is still adjusted. Also added animation for the divider when adjusting for ime. Bug: 36603383 Test: manual Change-Id: I456f3a726c62d130dce6c58c2245982e7f46454c --- .../systemui/stackdivider/DividerView.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java index 90c65580c7fdf..8f24ec712e83b 100644 --- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java +++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java @@ -767,17 +767,22 @@ public class DividerView extends FrameLayout implements OnTouchListener, mDockedStackMinimized = minimized; } else if (mDockedStackMinimized != minimized) { mIsInMinimizeInteraction = true; - if (minimized && (mCurrentAnimator == null || !mCurrentAnimator.isRunning())) { + if (minimized && (mCurrentAnimator == null || !mCurrentAnimator.isRunning()) + && (mDividerPositionBeforeMinimized <= 0 || !mAdjustedForIme)) { mDividerPositionBeforeMinimized = getCurrentPosition(); } mMinimizedSnapAlgorithm = null; mDockedStackMinimized = minimized; initializeSnapAlgorithm(); - stopDragging(getCurrentPosition(), minimized ? - mMinimizedSnapAlgorithm.getMiddleTarget() : - mSnapAlgorithm.calculateNonDismissingSnapTarget( + stopDragging(minimized + ? mDividerPositionBeforeMinimized + : getCurrentPosition(), + minimized + ? mMinimizedSnapAlgorithm.getMiddleTarget() + : mSnapAlgorithm.calculateNonDismissingSnapTarget( mDividerPositionBeforeMinimized), animDuration, Interpolators.FAST_OUT_SLOW_IN, 0); + setAdjustedForIme(false, animDuration); } if (!minimized) { mBackground.animate().withEndAction(mResetBackgroundRunnable); @@ -820,6 +825,9 @@ public class DividerView extends FrameLayout implements OnTouchListener, .setDuration(animDuration) .start(); mAdjustedForIme = adjustedForIme; + if (mHomeStackResizable && adjustedForIme) { + mDividerPositionBeforeMinimized = getCurrentPosition(); + } } private void resetBackground() {