Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df1eb8bb authored by Tony Wickham's avatar Tony Wickham
Browse files

Don't show back button when discovery bounce is playing

Bug: 74766552
Change-Id: Ib3b514f4a2bfaa8593b82cd5acb16f02dd09dcc7
parent 2998e432
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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);
+9 −1
Original line number Diff line number Diff line
@@ -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);
    }
}