From 3912b53d1869d7c08382b6f625ab376f023c47c0 Mon Sep 17 00:00:00 2001 From: Tony Huang Date: Fri, 2 Jul 2021 16:42:11 +0800 Subject: [PATCH] Set resizing to false if no fling animation While dobble taps gesture, it may moves the divider bar meanwhile, it means we set resizing to true but didn't set it back to false because position is same and no animation. We should set resizing to false for such status. Also fix such bug on legacy split screen. We call stopDragging with no animation in some status, it should call setResizing false too. Fix: 192635568 Test: Eanble stage split with any two apps and dobble tap on divider many times. Change-Id: I170e3de347cc5fc19eaa1cd3d64922b2b631e550 --- .../src/com/android/wm/shell/common/split/SplitLayout.java | 6 +++++- .../com/android/wm/shell/legacysplitscreen/DividerView.java | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java index be370aa82047b..8adfac01b462c 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java @@ -286,7 +286,11 @@ public final class SplitLayout { } private void flingDividePosition(int from, int to) { - if (from == to) return; + if (from == to) { + // No animation run, it should stop resizing here. + mSplitWindowManager.setResizingSplits(false); + return; + } ValueAnimator animator = ValueAnimator .ofInt(from, to) .setDuration(250); diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/DividerView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/DividerView.java index 362b40f33e893..9bed40d673359 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/DividerView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/DividerView.java @@ -460,6 +460,7 @@ public class DividerView extends FrameLayout implements OnTouchListener, private void stopDragging() { mHandle.setTouching(false, true /* animate */); mWindowManager.setSlippery(true); + mWindowManagerProxy.setResizing(false); releaseBackground(); }