Merge "Make sure divider show after DA info changed" into sc-v2-dev am: c7efed22c4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15358031 Change-Id: I4791771c87632623dd23ea398ef47f867cdcaf98
This commit is contained in:
@@ -620,22 +620,9 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
||||
}
|
||||
|
||||
mSyncQueue.runInSync(t -> {
|
||||
final SurfaceControl dividerLeash = mSplitLayout.getDividerLeash();
|
||||
final SurfaceControl sideStageLeash = mSideStage.mRootLeash;
|
||||
final SurfaceControl mainStageLeash = mMainStage.mRootLeash;
|
||||
|
||||
if (dividerLeash != null) {
|
||||
if (mDividerVisible) {
|
||||
t.show(dividerLeash)
|
||||
.setLayer(dividerLeash, Integer.MAX_VALUE)
|
||||
.setPosition(dividerLeash,
|
||||
mSplitLayout.getDividerBounds().left,
|
||||
mSplitLayout.getDividerBounds().top);
|
||||
} else {
|
||||
t.hide(dividerLeash);
|
||||
}
|
||||
}
|
||||
|
||||
if (sideStageVisible) {
|
||||
final Rect sideStageBounds = getSideStageBounds();
|
||||
t.show(sideStageLeash)
|
||||
@@ -662,9 +649,30 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
||||
} else {
|
||||
t.hide(mainStageLeash);
|
||||
}
|
||||
|
||||
applyDividerVisibility(t);
|
||||
});
|
||||
}
|
||||
|
||||
private void applyDividerVisibility(SurfaceControl.Transaction t) {
|
||||
final SurfaceControl dividerLeash = mSplitLayout.getDividerLeash();
|
||||
if (dividerLeash == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mDividerVisible) {
|
||||
t.show(dividerLeash)
|
||||
.setLayer(dividerLeash, Integer.MAX_VALUE)
|
||||
.setPosition(dividerLeash,
|
||||
mSplitLayout.getDividerBounds().left,
|
||||
mSplitLayout.getDividerBounds().top);
|
||||
} else {
|
||||
t.hide(dividerLeash);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void onStageHasChildrenChanged(StageListenerImpl stageListener) {
|
||||
final boolean hasChildren = stageListener.mHasChildren;
|
||||
final boolean isSideStage = stageListener == mSideStageListener;
|
||||
@@ -782,6 +790,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
||||
&& mSplitLayout.updateConfiguration(mDisplayAreaInfo.configuration)
|
||||
&& mMainStage.isActive()) {
|
||||
onBoundsChanged(mSplitLayout);
|
||||
mSyncQueue.runInSync(t -> applyDividerVisibility(t));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user