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

Commit

Permalink
Handle dim when history is opened
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Aug 27, 2019
1 parent f433f4c commit 2c0cda9
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public interface BookmarksViewDelegate {
boolean mHovered = false;
boolean mClickedAfterFocus = false;
boolean mIsBookmarksVisible = false;
boolean mIsHistoryVisible = false;

public interface WindowDelegate {
void onFocusRequest(@NonNull WindowWidget aWindow);
Expand Down Expand Up @@ -347,7 +348,6 @@ public void showBookmarks() {
listener.onBookmarksShown(this);
}
mIsBookmarksVisible = true;
mIsBookmarksVisible = false;
}

updateTitleBar();
Expand All @@ -359,6 +359,7 @@ public void hideBookmarks() {
for (BookmarksViewDelegate listener : mBookmarksViewListeners) {
listener.onBookmarksHidden(this);
}
mIsBookmarksVisible = false;
}
}

Expand All @@ -381,6 +382,7 @@ public void showHistory() {
for (HistoryViewDelegate listener : mHistoryViewListeners) {
listener.onHistoryViewShown(this);
}
mIsHistoryVisible = true;
}
}

Expand All @@ -390,6 +392,7 @@ public void hideHistory() {
for (HistoryViewDelegate listener : mHistoryViewListeners) {
listener.onHistoryViewHidden(this);
}
mIsHistoryVisible = false;
}
}

Expand Down Expand Up @@ -784,16 +787,17 @@ public void setVisible(boolean aVisible) {
}
mWidgetPlacement.visible = aVisible;
if (!aVisible) {
if (mIsBookmarksVisible) {
if (mIsBookmarksVisible || mIsHistoryVisible) {
mWidgetManager.popWorldBrightness(this);
}

} else {
if (mIsBookmarksVisible) {
if (mIsBookmarksVisible || mIsHistoryVisible) {
mWidgetManager.pushWorldBrightness(this, WidgetManagerDelegate.DEFAULT_DIM_BRIGHTNESS);
}
}
mIsBookmarksVisible = isBookmarksVisible();
mIsHistoryVisible = isHistoryVisible();
mWidgetManager.updateWidget(this);
if (!aVisible) {
clearFocus();
Expand Down

0 comments on commit 2c0cda9

Please sign in to comment.