Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java +17 −9 Original line number Diff line number Diff line Loading @@ -163,7 +163,8 @@ public class SplitDecorManager extends WindowlessWindowManager { /** Showing resizing hint. */ public void onResizing(ActivityManager.RunningTaskInfo resizingTask, Rect newBounds, Rect sideBounds, SurfaceControl.Transaction t, int offsetX, int offsetY) { Rect sideBounds, SurfaceControl.Transaction t, int offsetX, int offsetY, boolean immediately) { if (mResizingIconView == null) { return; } Loading @@ -178,8 +179,8 @@ public class SplitDecorManager extends WindowlessWindowManager { final boolean show = newBounds.width() > mBounds.width() || newBounds.height() > mBounds.height(); final boolean animate = show != mShown; if (animate && mFadeAnimator != null && mFadeAnimator.isRunning()) { final boolean update = show != mShown; if (update && mFadeAnimator != null && mFadeAnimator.isRunning()) { // If we need to animate and animator still running, cancel it before we ensure both // background and icon surfaces are non null for next animation. mFadeAnimator.cancel(); Loading @@ -192,7 +193,7 @@ public class SplitDecorManager extends WindowlessWindowManager { .setLayer(mBackgroundLeash, Integer.MAX_VALUE - 1); } if (mGapBackgroundLeash == null) { if (mGapBackgroundLeash == null && !immediately) { final boolean isLandscape = newBounds.height() == sideBounds.height(); final int left = isLandscape ? mBounds.width() : 0; final int top = isLandscape ? 0 : mBounds.height(); Loading Loading @@ -221,8 +222,13 @@ public class SplitDecorManager extends WindowlessWindowManager { newBounds.width() / 2 - mIconSize / 2, newBounds.height() / 2 - mIconSize / 2); if (animate) { if (update) { if (immediately) { t.setVisibility(mBackgroundLeash, show); t.setVisibility(mIconLeash, show); } else { startFadeAnimation(show, null /* finishedConsumer */); } mShown = show; } } Loading Loading @@ -319,10 +325,12 @@ public class SplitDecorManager extends WindowlessWindowManager { @Override public void onAnimationStart(@NonNull Animator animation) { if (show) { animT.show(mBackgroundLeash).show(mIconLeash).show(mGapBackgroundLeash).apply(); } else { animT.hide(mGapBackgroundLeash).apply(); animT.show(mBackgroundLeash).show(mIconLeash); } if (mGapBackgroundLeash != null) { animT.setVisibility(mGapBackgroundLeash, show); } animT.apply(); } @Override Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +2 −2 Original line number Diff line number Diff line Loading @@ -83,8 +83,8 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange private static final int FLING_RESIZE_DURATION = 250; private static final int FLING_SWITCH_DURATION = 350; private static final int FLING_ENTER_DURATION = 350; private static final int FLING_EXIT_DURATION = 350; private static final int FLING_ENTER_DURATION = 450; private static final int FLING_EXIT_DURATION = 450; private int mDividerWindowWidth; private int mDividerInsets; Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +6 −2 Original line number Diff line number Diff line Loading @@ -169,6 +169,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, private ValueAnimator mDividerFadeInAnimator; private boolean mDividerVisible; private boolean mKeyguardShowing; private boolean mShowDecorImmediately; private final SyncTransactionQueue mSyncQueue; private final ShellTaskOrganizer mTaskOrganizer; private final Context mContext; Loading Loading @@ -1556,6 +1557,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, if (mLogger.isEnterRequestedByDrag()) { updateSurfaceBounds(mSplitLayout, t, false /* applyResizingOffset */); } else { mShowDecorImmediately = true; mSplitLayout.flingDividerToCenter(); } }); Loading Loading @@ -1631,14 +1633,16 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, updateSurfaceBounds(layout, t, true /* applyResizingOffset */); getMainStageBounds(mTempRect1); getSideStageBounds(mTempRect2); mMainStage.onResizing(mTempRect1, mTempRect2, t, offsetX, offsetY); mSideStage.onResizing(mTempRect2, mTempRect1, t, offsetX, offsetY); mMainStage.onResizing(mTempRect1, mTempRect2, t, offsetX, offsetY, mShowDecorImmediately); mSideStage.onResizing(mTempRect2, mTempRect1, t, offsetX, offsetY, mShowDecorImmediately); t.apply(); mTransactionPool.release(t); } @Override public void onLayoutSizeChanged(SplitLayout layout) { // Reset this flag every time onLayoutSizeChanged. mShowDecorImmediately = false; final WindowContainerTransaction wct = new WindowContainerTransaction(); updateWindowBounds(layout, wct); sendOnBoundsChanged(); Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java +2 −2 Original line number Diff line number Diff line Loading @@ -289,10 +289,10 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener { } void onResizing(Rect newBounds, Rect sideBounds, SurfaceControl.Transaction t, int offsetX, int offsetY) { int offsetY, boolean immediately) { if (mSplitDecorManager != null && mRootTaskInfo != null) { mSplitDecorManager.onResizing(mRootTaskInfo, newBounds, sideBounds, t, offsetX, offsetY); offsetY, immediately); } } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java +17 −9 Original line number Diff line number Diff line Loading @@ -163,7 +163,8 @@ public class SplitDecorManager extends WindowlessWindowManager { /** Showing resizing hint. */ public void onResizing(ActivityManager.RunningTaskInfo resizingTask, Rect newBounds, Rect sideBounds, SurfaceControl.Transaction t, int offsetX, int offsetY) { Rect sideBounds, SurfaceControl.Transaction t, int offsetX, int offsetY, boolean immediately) { if (mResizingIconView == null) { return; } Loading @@ -178,8 +179,8 @@ public class SplitDecorManager extends WindowlessWindowManager { final boolean show = newBounds.width() > mBounds.width() || newBounds.height() > mBounds.height(); final boolean animate = show != mShown; if (animate && mFadeAnimator != null && mFadeAnimator.isRunning()) { final boolean update = show != mShown; if (update && mFadeAnimator != null && mFadeAnimator.isRunning()) { // If we need to animate and animator still running, cancel it before we ensure both // background and icon surfaces are non null for next animation. mFadeAnimator.cancel(); Loading @@ -192,7 +193,7 @@ public class SplitDecorManager extends WindowlessWindowManager { .setLayer(mBackgroundLeash, Integer.MAX_VALUE - 1); } if (mGapBackgroundLeash == null) { if (mGapBackgroundLeash == null && !immediately) { final boolean isLandscape = newBounds.height() == sideBounds.height(); final int left = isLandscape ? mBounds.width() : 0; final int top = isLandscape ? 0 : mBounds.height(); Loading Loading @@ -221,8 +222,13 @@ public class SplitDecorManager extends WindowlessWindowManager { newBounds.width() / 2 - mIconSize / 2, newBounds.height() / 2 - mIconSize / 2); if (animate) { if (update) { if (immediately) { t.setVisibility(mBackgroundLeash, show); t.setVisibility(mIconLeash, show); } else { startFadeAnimation(show, null /* finishedConsumer */); } mShown = show; } } Loading Loading @@ -319,10 +325,12 @@ public class SplitDecorManager extends WindowlessWindowManager { @Override public void onAnimationStart(@NonNull Animator animation) { if (show) { animT.show(mBackgroundLeash).show(mIconLeash).show(mGapBackgroundLeash).apply(); } else { animT.hide(mGapBackgroundLeash).apply(); animT.show(mBackgroundLeash).show(mIconLeash); } if (mGapBackgroundLeash != null) { animT.setVisibility(mGapBackgroundLeash, show); } animT.apply(); } @Override Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +2 −2 Original line number Diff line number Diff line Loading @@ -83,8 +83,8 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange private static final int FLING_RESIZE_DURATION = 250; private static final int FLING_SWITCH_DURATION = 350; private static final int FLING_ENTER_DURATION = 350; private static final int FLING_EXIT_DURATION = 350; private static final int FLING_ENTER_DURATION = 450; private static final int FLING_EXIT_DURATION = 450; private int mDividerWindowWidth; private int mDividerInsets; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +6 −2 Original line number Diff line number Diff line Loading @@ -169,6 +169,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, private ValueAnimator mDividerFadeInAnimator; private boolean mDividerVisible; private boolean mKeyguardShowing; private boolean mShowDecorImmediately; private final SyncTransactionQueue mSyncQueue; private final ShellTaskOrganizer mTaskOrganizer; private final Context mContext; Loading Loading @@ -1556,6 +1557,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, if (mLogger.isEnterRequestedByDrag()) { updateSurfaceBounds(mSplitLayout, t, false /* applyResizingOffset */); } else { mShowDecorImmediately = true; mSplitLayout.flingDividerToCenter(); } }); Loading Loading @@ -1631,14 +1633,16 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, updateSurfaceBounds(layout, t, true /* applyResizingOffset */); getMainStageBounds(mTempRect1); getSideStageBounds(mTempRect2); mMainStage.onResizing(mTempRect1, mTempRect2, t, offsetX, offsetY); mSideStage.onResizing(mTempRect2, mTempRect1, t, offsetX, offsetY); mMainStage.onResizing(mTempRect1, mTempRect2, t, offsetX, offsetY, mShowDecorImmediately); mSideStage.onResizing(mTempRect2, mTempRect1, t, offsetX, offsetY, mShowDecorImmediately); t.apply(); mTransactionPool.release(t); } @Override public void onLayoutSizeChanged(SplitLayout layout) { // Reset this flag every time onLayoutSizeChanged. mShowDecorImmediately = false; final WindowContainerTransaction wct = new WindowContainerTransaction(); updateWindowBounds(layout, wct); sendOnBoundsChanged(); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java +2 −2 Original line number Diff line number Diff line Loading @@ -289,10 +289,10 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener { } void onResizing(Rect newBounds, Rect sideBounds, SurfaceControl.Transaction t, int offsetX, int offsetY) { int offsetY, boolean immediately) { if (mSplitDecorManager != null && mRootTaskInfo != null) { mSplitDecorManager.onResizing(mRootTaskInfo, newBounds, sideBounds, t, offsetX, offsetY); offsetY, immediately); } } Loading