Merge "Revert "Only add divider when it need to show"" into rvc-dev

This commit is contained in:
TreeHugger Robot
2020-06-15 07:59:00 +00:00
committed by Android (Google) Code Review
2 changed files with 10 additions and 5 deletions

View File

@@ -253,9 +253,7 @@ public class Divider extends SystemUI implements DividerView.DividerCallbacks,
mSplitLayout.mSecondary = new Rect(mRotateSplitLayout.mSecondary);
mRotateSplitLayout = null;
}
if (isSplitActive()) {
update(newConfig);
}
update(newConfig);
}
Handler getHandler() {
@@ -330,6 +328,11 @@ public class Divider extends SystemUI implements DividerView.DividerCallbacks,
mHandler.post(this::removeDivider);
}
void onTasksReady() {
mHandler.post(() -> update(mDisplayController.getDisplayContext(
mContext.getDisplayId()).getResources().getConfiguration()));
}
private void updateVisibility(final boolean visible) {
if (DEBUG) Slog.d(TAG, "Updating visibility " + mVisible + "->" + visible);
if (mVisible != visible) {
@@ -521,7 +524,7 @@ public class Divider extends SystemUI implements DividerView.DividerCallbacks,
void ensureMinimizedSplit() {
setHomeMinimized(true /* minimized */, mSplits.mSecondary.isResizable());
if (mView != null && !isDividerVisible()) {
if (!isDividerVisible()) {
// Wasn't in split-mode yet, so enter now.
if (DEBUG) {
Slog.d(TAG, " entering split mode with minimized=true");
@@ -532,7 +535,7 @@ public class Divider extends SystemUI implements DividerView.DividerCallbacks,
void ensureNormalSplit() {
setHomeMinimized(false /* minimized */, mHomeStackResizable);
if (mView != null && !isDividerVisible()) {
if (!isDividerVisible()) {
// Wasn't in split-mode, so enter now.
if (DEBUG) {
Slog.d(TAG, " enter split mode unminimized ");

View File

@@ -113,6 +113,8 @@ class SplitScreenTaskOrganizer extends TaskOrganizer {
t.setColor(mSecondaryDim, new float[]{0f, 0f, 0f});
t.apply();
releaseTransaction(t);
mDivider.onTasksReady();
}
}
}