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

Commit 52cb0a73 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Go back to previous state when hitting back from discovery bounce" into...

Merge "Go back to previous state when hitting back from discovery bounce" into ub-launcher3-edmonton
parents bd6fba9f 52c1b66f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -123,9 +123,11 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch

    protected abstract boolean isOfType(@FloatingViewType int type);

    public void onBackPressed() {
    /** @return Whether the back is consumed. If false, Launcher will handle the back as well. */
    public boolean onBackPressed() {
        logActionCommand(Action.Command.BACK);
        close(true);
        return true;
    }

    @Override
+2 −2
Original line number Diff line number Diff line
@@ -1599,8 +1599,8 @@ public class Launcher extends BaseDraggingActivity
        // by using if-else statements.
        UserEventDispatcher ued = getUserEventDispatcher();
        AbstractFloatingView topView = AbstractFloatingView.getTopOpenView(this);
        if (topView != null) {
            topView.onBackPressed();
        if (topView != null && topView.onBackPressed()) {
            // Handled by the floating view.
        } else if (!isInState(NORMAL)) {
            LauncherState lastState = mStateManager.getLastState();
            ued.logActionCommand(Action.Command.BACK, mStateManager.getState().containerType,
+8 −0
Original line number Diff line number Diff line
@@ -83,6 +83,14 @@ public class DiscoveryBounce extends AbstractFloatingView {
        }
    }

    @Override
    public boolean onBackPressed() {
        super.onBackPressed();
        // Go back to the previous state (from a user's perspective this floating view isn't
        // something to go back from).
        return false;
    }

    @Override
    public boolean onControllerInterceptTouchEvent(MotionEvent ev) {
        handleClose(false);
+2 −1
Original line number Diff line number Diff line
@@ -1437,12 +1437,13 @@ public class Folder extends AbstractFloatingView implements DragSource,
    }

    @Override
    public void onBackPressed() {
    public boolean onBackPressed() {
        if (isEditingName()) {
            mFolderName.dispatchBackKey();
        } else {
            super.onBackPressed();
        }
        return true;
    }

    @Override