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

Commit 338fa3e9 authored by Brian Isganitis's avatar Brian Isganitis
Browse files

Delay hiding Taskbar EDU until entering home or overview.

EDU will now end up hiding due to
TaskbarLauncherStateController#onStateChangeApplied closing all AFVs if
we are going to home or overview.

This is a quickfix to make it harder to accidentally close the EDU when
testing out the transient taskbar. We will eventually be moving to a
lighter EDU UI where having gestures occuring behind it will be less
awkward.

Test: Manual
Bug: 260769010
Change-Id: I477abe9339ed10cb3aed8d1a0fbe0e22ac14c7ab
parent 2a2f1b6c
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -877,16 +877,6 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
        mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(false);
    }

    /** Called when we want to hide the overlay window when user performs swipe up gesture. */
    public void onSwipeToHideOverlay() {
        mControllers.taskbarOverlayController.hideWindow();
    }

    /** Returns {@code true} if taskbar is stashed. */
    public boolean isTaskbarStashed() {
        return mControllers.taskbarStashController.isStashed();
    }

    /** Returns {@code true} if taskbar All Apps is open. */
    public boolean isTaskbarAllAppsOpen() {
        return mControllers.taskbarAllAppsController.isOpen();
+0 −19
Original line number Diff line number Diff line
@@ -54,11 +54,8 @@ public class TaskbarStashInputConsumer extends DelegateInputConsumer {
    private final float mScreenWidth;

    private final int mTaskbarNavThresholdY;
    private final int mTaskbarAppWindowThresholdY;
    private final boolean mTaskbarAlreadyOpen;
    private final boolean mIsTaskbarAllAppsOpen;
    private boolean mHasPassedTaskbarNavThreshold;
    private boolean mHasPassedTaskbarAppWindowThreshold;

    private final PointF mDownPos = new PointF();
    private final PointF mLastPos = new PointF();
@@ -80,15 +77,8 @@ public class TaskbarStashInputConsumer extends DelegateInputConsumer {
        int taskbarNavThreshold = res.getDimensionPixelSize(ENABLE_TASKBAR_REVISED_THRESHOLDS.get()
                ? R.dimen.taskbar_nav_threshold_v2
                : R.dimen.taskbar_nav_threshold);
        int taskbarAppWindowThreshold = res.getDimensionPixelSize(
                ENABLE_TASKBAR_REVISED_THRESHOLDS.get()
                        ? R.dimen.taskbar_app_window_threshold_v2
                        : R.dimen.taskbar_app_window_threshold);
        int screenHeight = taskbarActivityContext.getDeviceProfile().heightPx;
        mTaskbarNavThresholdY = screenHeight - taskbarNavThreshold;
        mTaskbarAppWindowThresholdY = screenHeight - taskbarAppWindowThreshold;
        mTaskbarAlreadyOpen = mTaskbarActivityContext != null
                && !mTaskbarActivityContext.isTaskbarStashed();
        mIsTaskbarAllAppsOpen =
                mTaskbarActivityContext != null && mTaskbarActivityContext.isTaskbarAllAppsOpen();

@@ -127,7 +117,6 @@ public class TaskbarStashInputConsumer extends DelegateInputConsumer {
                        mLastPos.set(mDownPos);

                        mHasPassedTaskbarNavThreshold = false;
                        mHasPassedTaskbarAppWindowThreshold = false;
                        mTaskbarActivityContext.setAutohideSuspendFlag(
                                FLAG_AUTOHIDE_SUSPEND_TOUCHING, true);
                        if (isInArea(x)) {
@@ -172,18 +161,11 @@ public class TaskbarStashInputConsumer extends DelegateInputConsumer {
                            float dY = mLastPos.y - mDownPos.y;
                            boolean passedTaskbarNavThreshold = dY < 0
                                    && mLastPos.y < mTaskbarNavThresholdY;
                            boolean passedTaskbarAppWindowThreshold = dY < 0
                                    && mLastPos.y < mTaskbarAppWindowThresholdY;

                            if (!mHasPassedTaskbarNavThreshold && passedTaskbarNavThreshold) {
                                mHasPassedTaskbarNavThreshold = true;
                                mTaskbarActivityContext.onSwipeToUnstashTaskbar();
                            }
                            if (mTaskbarAlreadyOpen || (!mHasPassedTaskbarAppWindowThreshold
                                    && passedTaskbarAppWindowThreshold)) {
                                mHasPassedTaskbarAppWindowThreshold = true;
                                mTaskbarActivityContext.onSwipeToHideOverlay();
                            }

                            if (dY < 0) {
                                dY = -OverScroll.dampedScroll(-dY, mTaskbarNavThresholdY);
@@ -205,7 +187,6 @@ public class TaskbarStashInputConsumer extends DelegateInputConsumer {
                            mTransitionCallback.onActionEnd();
                        }
                        mHasPassedTaskbarNavThreshold = false;
                        mHasPassedTaskbarAppWindowThreshold = false;
                        break;
                }
            }