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

Commit 14d912b0 authored by Schneider Victor-tulias's avatar Schneider Victor-tulias
Browse files

Close the KQS view when touching the gesture nav region

Also, stop handling KQS open/close during gestures

Flag: LEGACY ENABLE_KEYBOARD_QUICK_SWITCH ENABLED
Fixes: 328689890
Fixes: 328689534
Fixes: 328692760
Test: attempted gestures while KQS is shown. attempted KQS while attempting gestures
Change-Id: Idbd1f9cef09d9fbf611350d0847d94ccf8300369
parent 975a0695
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -193,10 +193,14 @@ public final class KeyboardQuickSwitchController implements
    }

    void closeQuickSwitchView() {
        closeQuickSwitchView(true);
    }

    void closeQuickSwitchView(boolean animate) {
        if (mQuickSwitchViewController == null) {
            return;
        }
        mQuickSwitchViewController.closeQuickSwitchView(true);
        mQuickSwitchViewController.closeQuickSwitchView(animate);
    }

    /**
+5 −0
Original line number Diff line number Diff line
@@ -1553,4 +1553,9 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
    public float getStashedTaskbarScale() {
        return mControllers.stashedHandleViewController.getStashedHandleHintScale().value;
    }

    /** Closes the KeyboardQuickSwitchView without an animation if open. */
    public void closeKeyboardQuickSwitchView() {
        mControllers.keyboardQuickSwitchController.closeQuickSwitchView(false);
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -248,7 +248,15 @@ public class OverviewCommandHelper {
                case TYPE_SHOW:
                    // already visible
                    return true;
                case TYPE_KEYBOARD_INPUT: {
                    if (visibleRecentsView.isHandlingTouch()) {
                        return true;
                    }
                }
                case TYPE_HIDE: {
                    if (visibleRecentsView.isHandlingTouch()) {
                        return true;
                    }
                    mKeyboardTaskFocusIndex = INVALID_PAGE;
                    int currentPage = visibleRecentsView.getNextPage();
                    TaskView tv = (currentPage >= 0
+4 −0
Original line number Diff line number Diff line
@@ -753,6 +753,10 @@ public class TouchInteractionService extends Service {

            boolean isOneHandedModeActive = mDeviceState.isOneHandedModeActive();
            boolean isInSwipeUpTouchRegion = mRotationTouchHelper.isInSwipeUpTouchRegion(event);
            TaskbarActivityContext tac = mTaskbarManager.getCurrentActivityContext();
            if (isInSwipeUpTouchRegion && tac != null) {
                tac.closeKeyboardQuickSwitchView();
            }
            if ((!isOneHandedModeActive && isInSwipeUpTouchRegion)
                    || isHoverActionWithoutConsumer) {
                reasonString.append(!isOneHandedModeActive && isInSwipeUpTouchRegion
+23 −22
Original line number Diff line number Diff line
@@ -4224,7 +4224,9 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T

    @Override
    public boolean dispatchKeyEvent(KeyEvent event) {
        if (event.getAction() == KeyEvent.ACTION_DOWN) {
        if (isHandlingTouch() || event.getAction() != KeyEvent.ACTION_DOWN) {
            return super.dispatchKeyEvent(event);
        }
        switch (event.getKeyCode()) {
            case KeyEvent.KEYCODE_TAB:
                return snapToPageRelative(event.isShiftPressed() ? -1 : 1, true /* cycle */,
@@ -4248,7 +4250,6 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
                    return true;
                }
        }
        }
        return super.dispatchKeyEvent(event);
    }