Merge "Reduce flicker when resize animation" into tm-dev
This commit is contained in:
@@ -171,6 +171,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
private boolean mShouldUpdateRecents;
|
private boolean mShouldUpdateRecents;
|
||||||
private boolean mExitSplitScreenOnHide;
|
private boolean mExitSplitScreenOnHide;
|
||||||
private boolean mIsDividerRemoteAnimating;
|
private boolean mIsDividerRemoteAnimating;
|
||||||
|
private boolean mResizingSplits;
|
||||||
|
|
||||||
/** The target stage to dismiss to when unlock after folded. */
|
/** The target stage to dismiss to when unlock after folded. */
|
||||||
@StageType
|
@StageType
|
||||||
@@ -1093,10 +1094,11 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSnappedToDismiss(boolean bottomOrRight) {
|
public void onSnappedToDismiss(boolean bottomOrRight) {
|
||||||
|
setResizingSplits(false /* resizing */);
|
||||||
|
|
||||||
final boolean mainStageToTop =
|
final boolean mainStageToTop =
|
||||||
bottomOrRight ? mSideStagePosition == SPLIT_POSITION_BOTTOM_OR_RIGHT
|
bottomOrRight ? mSideStagePosition == SPLIT_POSITION_BOTTOM_OR_RIGHT
|
||||||
: mSideStagePosition == SPLIT_POSITION_TOP_OR_LEFT;
|
: mSideStagePosition == SPLIT_POSITION_TOP_OR_LEFT;
|
||||||
|
|
||||||
if (!ENABLE_SHELL_TRANSITIONS) {
|
if (!ENABLE_SHELL_TRANSITIONS) {
|
||||||
exitSplitScreen(mainStageToTop ? mMainStage : mSideStage, EXIT_REASON_DRAG_DIVIDER);
|
exitSplitScreen(mainStageToTop ? mMainStage : mSideStage, EXIT_REASON_DRAG_DIVIDER);
|
||||||
return;
|
return;
|
||||||
@@ -1125,6 +1127,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
@Override
|
@Override
|
||||||
public void onLayoutSizeChanging(SplitLayout layout) {
|
public void onLayoutSizeChanging(SplitLayout layout) {
|
||||||
mSyncQueue.runInSync(t -> {
|
mSyncQueue.runInSync(t -> {
|
||||||
|
setResizingSplits(true /* resizing */);
|
||||||
updateSurfaceBounds(layout, t);
|
updateSurfaceBounds(layout, t);
|
||||||
mMainStage.onResizing(getMainStageBounds(), t);
|
mMainStage.onResizing(getMainStageBounds(), t);
|
||||||
mSideStage.onResizing(getSideStageBounds(), t);
|
mSideStage.onResizing(getSideStageBounds(), t);
|
||||||
@@ -1138,6 +1141,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
updateUnfoldBounds();
|
updateUnfoldBounds();
|
||||||
mSyncQueue.queue(wct);
|
mSyncQueue.queue(wct);
|
||||||
mSyncQueue.runInSync(t -> {
|
mSyncQueue.runInSync(t -> {
|
||||||
|
setResizingSplits(false /* resizing */);
|
||||||
updateSurfaceBounds(layout, t);
|
updateSurfaceBounds(layout, t);
|
||||||
mMainStage.onResized(t);
|
mMainStage.onResized(t);
|
||||||
mSideStage.onResized(t);
|
mSideStage.onResized(t);
|
||||||
@@ -1179,6 +1183,16 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
bottomRightStage.mRootLeash, topLeftStage.mDimLayer, bottomRightStage.mDimLayer);
|
bottomRightStage.mRootLeash, topLeftStage.mDimLayer, bottomRightStage.mDimLayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setResizingSplits(boolean resizing) {
|
||||||
|
if (resizing == mResizingSplits) return;
|
||||||
|
try {
|
||||||
|
ActivityTaskManager.getService().setSplitScreenResizing(resizing);
|
||||||
|
mResizingSplits = resizing;
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
Slog.w(TAG, "Error calling setSplitScreenResizing", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSplitItemPosition(WindowContainerToken token) {
|
public int getSplitItemPosition(WindowContainerToken token) {
|
||||||
if (token == null) {
|
if (token == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user