diff --git a/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java b/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java index 9507a366b3..a180456de0 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java +++ b/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java @@ -16,6 +16,8 @@ package com.android.launcher3.uioverrides; +import static com.android.launcher3.AbstractFloatingView.TYPE_ALL; +import static com.android.launcher3.AbstractFloatingView.TYPE_HIDE_BACK_BUTTON; import static com.android.launcher3.LauncherState.ALL_APPS; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.OVERVIEW; @@ -74,7 +76,8 @@ public class UiFactory { && launcher.hasWindowFocus(); if (shouldBackButtonBeHidden) { // Show the back button if there is a floating view visible. - shouldBackButtonBeHidden = AbstractFloatingView.getTopOpenView(launcher) == null; + shouldBackButtonBeHidden = AbstractFloatingView.getTopOpenViewWithType(launcher, + TYPE_ALL & ~TYPE_HIDE_BACK_BUTTON) == null; } OverviewInteractionState.getInstance(launcher) .setBackButtonVisible(!shouldBackButtonBeHidden); diff --git a/src/com/android/launcher3/AbstractFloatingView.java b/src/com/android/launcher3/AbstractFloatingView.java index b0c5baf6b5..693cf31375 100644 --- a/src/com/android/launcher3/AbstractFloatingView.java +++ b/src/com/android/launcher3/AbstractFloatingView.java @@ -70,6 +70,9 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch public static final int TYPE_REBIND_SAFE = TYPE_WIDGETS_FULL_SHEET | TYPE_QUICKSTEP_PREVIEW | TYPE_ON_BOARD_POPUP; + // Usually we show the back button when a floating view is open. Instead, hide for these types. + public static final int TYPE_HIDE_BACK_BUTTON = TYPE_ON_BOARD_POPUP; + protected boolean mIsOpen; public AbstractFloatingView(Context context, AttributeSet attrs) { @@ -170,6 +173,11 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch } public static AbstractFloatingView getTopOpenView(BaseDraggingActivity activity) { - return getOpenView(activity, TYPE_ALL); + return getTopOpenViewWithType(activity, TYPE_ALL); + } + + public static AbstractFloatingView getTopOpenViewWithType(BaseDraggingActivity activity, + @FloatingViewType int type) { + return getOpenView(activity, type); } }