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

Commit

Permalink
Hide the hamburger menu when switching windows. (#3823)
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo authored Aug 18, 2020
1 parent 3afa6fa commit 2d8de16
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ public void removeNavigationBarListener(@Nullable NavigationListener listener) {

@Override
public void detachFromWindow() {
hideMenu();
hideAllNotifications();

if (mAttachedWindow != null && mAttachedWindow.isResizing()) {
Expand Down Expand Up @@ -629,6 +630,7 @@ protected void onDraw(Canvas canvas) {
}

private void enterFullScreenMode() {
hideMenu();
hideAllNotifications();

mWidgetManager.pushBackHandler(mFullScreenBackHandler);
Expand Down Expand Up @@ -665,6 +667,7 @@ private void enterFullScreenMode() {
}

private void exitFullScreenMode() {
hideMenu();
hideAllNotifications();

if (mAttachedWindow == null || !mAttachedWindow.isFullScreen()) {
Expand Down Expand Up @@ -695,6 +698,7 @@ private void exitFullScreenMode() {
}

private void enterResizeMode() {
hideMenu();
hideAllNotifications();

if (mAttachedWindow.isResizing()) {
Expand Down Expand Up @@ -1209,7 +1213,7 @@ public void onAddons() {

private void hideMenu() {
if (mHamburgerMenu != null) {
mHamburgerMenu.hide(UIWidget.REMOVE_WIDGET);
mHamburgerMenu.hide(UIWidget.REMOVE_WIDGET, false);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,17 @@ public void show(int aShowFlags) {

@Override
public void hide(int aHideFlags) {
AnimationHelper.scaleOut(findViewById(R.id.menuContainer), 100, 0, () -> HamburgerMenuWidget.super.hide(aHideFlags));
hide(aHideFlags, true);
}

public void hide(int aHideFlags, boolean anim) {
if (anim) {
AnimationHelper.scaleOut(findViewById(R.id.menuContainer), 100, 0, () -> HamburgerMenuWidget.super.hide(aHideFlags));

} else {
HamburgerMenuWidget.super.hide(aHideFlags);
}

mWidgetPlacement.proxifyLayer = false;

if (mWidgetManager != null) {
Expand Down

0 comments on commit 2d8de16

Please sign in to comment.