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

Commit 734be27f authored by Tony Wickham's avatar Tony Wickham
Browse files

Intercept touch events from anywhere while all apps is closing

Previously we did this only from a settled state, but now we also
do it during the transition to NORMAL.

Test: open all apps. Then, swipe down to home and back up to all
apps (from above the top of all apps).

Fixes: 159856104
Change-Id: Ib78c6a41d5fa17dd26a7df4e9069e0ada1f46dd0
parent 8e1b32d8
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -89,13 +89,16 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr

    @Override
    protected boolean canInterceptTouch(MotionEvent ev) {
        // If we are swiping to all apps instead of overview, allow it from anywhere.
        boolean interceptAnywhere = mLauncher.isInState(NORMAL) && !mAllowDragToOverview;
        if (mCurrentAnimation != null) {
            if (mFinishFastOnSecondTouch) {
                mCurrentAnimation.getAnimationPlayer().end();
            }

            AllAppsTransitionController allAppsController = mLauncher.getAllAppsController();
            if (ev.getY() >= allAppsController.getShiftRange() * allAppsController.getProgress()) {
            if (ev.getY() >= allAppsController.getShiftRange() * allAppsController.getProgress()
                    || interceptAnywhere) {
                // If we are already animating from a previous state, we can intercept as long as
                // the touch is below the current all apps progress (to allow for double swipe).
                return true;
@@ -117,9 +120,7 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
                return false;
            }
        } else {
            // If we are swiping to all apps instead of overview, allow it from anywhere.
            boolean interceptAnywhere = mLauncher.isInState(NORMAL) && !mAllowDragToOverview;
            // For all other states, only listen if the event originated below the hotseat height
            // For non-normal states, only listen if the event originated below the hotseat height
            if (!interceptAnywhere && !isTouchOverHotseat(mLauncher, ev)) {
                return false;
            }