diff options
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java | 9 | ||||
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java | 11 |
2 files changed, 14 insertions, 6 deletions
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 d261e2435b5f..55b8eec9a302 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 @@ -620,10 +620,15 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange } /** Fling divider from current position to center position. */ - public void flingDividerToCenter() { + public void flingDividerToCenter(@Nullable Runnable finishCallback) { final int pos = mDividerSnapAlgorithm.getMiddleTarget().position; flingDividePosition(getDividePosition(), pos, FLING_ENTER_DURATION, - () -> setDividePosition(pos, true /* applyLayoutChange */)); + () -> { + setDividePosition(pos, true /* applyLayoutChange */); + if (finishCallback != null) { + finishCallback.run(); + } + }); } @VisibleForTesting diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java index 0c2524e80f98..53463a7fe593 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java @@ -2108,7 +2108,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, mSkipEvictingMainStageChildren = false; } else { mShowDecorImmediately = true; - mSplitLayout.flingDividerToCenter(); + mSplitLayout.flingDividerToCenter(/*finishCallback*/ null); } }); } @@ -2308,7 +2308,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, mSkipEvictingMainStageChildren = false; } else { mShowDecorImmediately = true; - mSplitLayout.flingDividerToCenter(); + mSplitLayout.flingDividerToCenter(/*finishCallback*/ null); } }); } @@ -3144,7 +3144,10 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, final TransitionInfo.Change finalMainChild = mainChild; final TransitionInfo.Change finalSideChild = sideChild; enterTransition.setFinishedCallback((callbackWct, callbackT) -> { - notifySplitAnimationFinished(); + if (!enterTransition.mResizeAnim) { + // If resizing, we'll call notify at the end of the resizing animation (below) + notifySplitAnimationFinished(); + } if (finalMainChild != null) { if (!mainNotContainOpenTask) { mMainStage.evictOtherChildren(callbackWct, finalMainChild.getTaskInfo().taskId); @@ -3164,7 +3167,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, } if (enterTransition.mResizeAnim) { mShowDecorImmediately = true; - mSplitLayout.flingDividerToCenter(); + mSplitLayout.flingDividerToCenter(this::notifySplitAnimationFinished); } callbackWct.setReparentLeafTaskIfRelaunch(mRootTaskInfo.token, false); mPausingTasks.clear(); |