Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Improve Window visibility in transitions (#2790)
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo authored Feb 17, 2020
1 parent f8bdc7b commit ecaeed6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ public void enterPrivateMode() {
return;
}
mPrivateMode = true;
updateCurvedMode(true);

if (mFocusedWindow != null) {
mRegularWindowPlacement = mFocusedWindow.getWindowPlacement();

Expand All @@ -538,6 +538,10 @@ public void enterPrivateMode() {
for (WindowWidget window: mRegularWindows) {
setWindowVisible(window, false);
}

updateViews();
updateCurvedMode(true);

for (WindowWidget window: mPrivateWindows) {
setWindowVisible(window, true);
}
Expand All @@ -551,7 +555,7 @@ public void enterPrivateMode() {
} else {
focusWindow(getWindowWithPlacement(mPrivateWindowPlacement));
}
updateViews();

mWidgetManager.pushWorldBrightness(this, WidgetManagerDelegate.DEFAULT_DIM_BRIGHTNESS);
}

Expand All @@ -560,7 +564,7 @@ public void exitPrivateMode() {
return;
}
mPrivateMode = false;
updateCurvedMode(true);

if (mFocusedWindow != null) {
mPrivateWindowPlacement = mFocusedWindow.getWindowPlacement();

Expand All @@ -570,14 +574,18 @@ public void exitPrivateMode() {
for (WindowWidget window: mPrivateWindows) {
setWindowVisible(window, false);
}

updateViews();
updateCurvedMode(true);

for (WindowWidget window: mRegularWindows) {
setWindowVisible(window, true);
}
WindowWidget window = getWindowWithPlacement(mRegularWindowPlacement);
if (window != null) {
focusWindow(window);
}
updateViews();

mWidgetManager.popWorldBrightness(this);
}

Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/top_bar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center_horizontal">
android:gravity="center_horizontal"
app:visibleGone="@{viewmodel.isWindowVisible}">

<FrameLayout
android:layout_width="45dp"
Expand Down

0 comments on commit ecaeed6

Please sign in to comment.