Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java +4 −2 Original line number Diff line number Diff line Loading @@ -296,13 +296,15 @@ public class QuickStepController implements GestureHelper { } else if (exceededSwipeHorizontalTouchSlop) { if (mDragHPositive ? (posH < touchDownH) : (posH > touchDownH)) { // Swiping left (rtl) gesture int index = isEdgeSwipeAlongNavBar(touchDownH, !mDragHPositive) int index = mGestureActions[ACTION_SWIPE_LEFT_FROM_EDGE_INDEX] != null && isEdgeSwipeAlongNavBar(touchDownH, !mDragHPositive) ? ACTION_SWIPE_LEFT_FROM_EDGE_INDEX : ACTION_SWIPE_LEFT_INDEX; tryToStartGesture(mGestureActions[index], true /* alignedWithNavBar */, event); } else { // Swiping right (ltr) gesture int index = isEdgeSwipeAlongNavBar(touchDownH, mDragHPositive) int index = mGestureActions[ACTION_SWIPE_RIGHT_FROM_EDGE_INDEX] != null && isEdgeSwipeAlongNavBar(touchDownH, mDragHPositive) ? ACTION_SWIPE_RIGHT_FROM_EDGE_INDEX : ACTION_SWIPE_RIGHT_INDEX; tryToStartGesture(mGestureActions[index], true /* alignedWithNavBar */, event); Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/QuickStepControllerTest.java +19 −1 Original line number Diff line number Diff line Loading @@ -601,6 +601,25 @@ public class QuickStepControllerTest extends SysuiTestCase { assertGestureDragsHitTargetAllDirections(buttonView, true /* isRTL */, NAV_BAR_LEFT); } @Test public void testNoEdgeActionsTriggerNormalActions() { doReturn(NAVBAR_WIDTH).when(mNavigationBarView).getWidth(); doReturn(NAVBAR_HEIGHT).when(mNavigationBarView).getHeight(); NavigationGestureAction swipeUp = mockAction(true); NavigationGestureAction swipeDown = mockAction(true); NavigationGestureAction swipeLeft = mockAction(true); NavigationGestureAction swipeRight = mockAction(true); mController.setGestureActions(swipeUp, swipeDown, swipeLeft, swipeRight, null /* swipeLeftFromEdgeAction */, null /* swipeLeftFromEdgeAction */); // Swipe Left from Edge assertGestureTriggersAction(swipeLeft, NAVBAR_WIDTH, 1, 5, 1); // Swipe Right from Edge assertGestureTriggersAction(swipeRight, 0, 1, NAVBAR_WIDTH, 5); } private void assertGestureDragsHitTargetAllDirections(View buttonView, boolean isRTL, int navPos) { mController.setBarState(isRTL, navPos); Loading Loading @@ -665,7 +684,6 @@ public class QuickStepControllerTest extends SysuiTestCase { reset(buttonView); } private MotionEvent event(int action, float x, float y) { final MotionEvent event = mock(MotionEvent.class); doReturn(x).when(event).getX(); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java +4 −2 Original line number Diff line number Diff line Loading @@ -296,13 +296,15 @@ public class QuickStepController implements GestureHelper { } else if (exceededSwipeHorizontalTouchSlop) { if (mDragHPositive ? (posH < touchDownH) : (posH > touchDownH)) { // Swiping left (rtl) gesture int index = isEdgeSwipeAlongNavBar(touchDownH, !mDragHPositive) int index = mGestureActions[ACTION_SWIPE_LEFT_FROM_EDGE_INDEX] != null && isEdgeSwipeAlongNavBar(touchDownH, !mDragHPositive) ? ACTION_SWIPE_LEFT_FROM_EDGE_INDEX : ACTION_SWIPE_LEFT_INDEX; tryToStartGesture(mGestureActions[index], true /* alignedWithNavBar */, event); } else { // Swiping right (ltr) gesture int index = isEdgeSwipeAlongNavBar(touchDownH, mDragHPositive) int index = mGestureActions[ACTION_SWIPE_RIGHT_FROM_EDGE_INDEX] != null && isEdgeSwipeAlongNavBar(touchDownH, mDragHPositive) ? ACTION_SWIPE_RIGHT_FROM_EDGE_INDEX : ACTION_SWIPE_RIGHT_INDEX; tryToStartGesture(mGestureActions[index], true /* alignedWithNavBar */, event); Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/QuickStepControllerTest.java +19 −1 Original line number Diff line number Diff line Loading @@ -601,6 +601,25 @@ public class QuickStepControllerTest extends SysuiTestCase { assertGestureDragsHitTargetAllDirections(buttonView, true /* isRTL */, NAV_BAR_LEFT); } @Test public void testNoEdgeActionsTriggerNormalActions() { doReturn(NAVBAR_WIDTH).when(mNavigationBarView).getWidth(); doReturn(NAVBAR_HEIGHT).when(mNavigationBarView).getHeight(); NavigationGestureAction swipeUp = mockAction(true); NavigationGestureAction swipeDown = mockAction(true); NavigationGestureAction swipeLeft = mockAction(true); NavigationGestureAction swipeRight = mockAction(true); mController.setGestureActions(swipeUp, swipeDown, swipeLeft, swipeRight, null /* swipeLeftFromEdgeAction */, null /* swipeLeftFromEdgeAction */); // Swipe Left from Edge assertGestureTriggersAction(swipeLeft, NAVBAR_WIDTH, 1, 5, 1); // Swipe Right from Edge assertGestureTriggersAction(swipeRight, 0, 1, NAVBAR_WIDTH, 5); } private void assertGestureDragsHitTargetAllDirections(View buttonView, boolean isRTL, int navPos) { mController.setBarState(isRTL, navPos); Loading Loading @@ -665,7 +684,6 @@ public class QuickStepControllerTest extends SysuiTestCase { reset(buttonView); } private MotionEvent event(int action, float x, float y) { final MotionEvent event = mock(MotionEvent.class); doReturn(x).when(event).getX(); Loading