Loading quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -621,7 +621,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, final boolean passed = mCurrentShift.value >= MIN_PROGRESS_FOR_OVERVIEW; final boolean passed = mCurrentShift.value >= MIN_PROGRESS_FOR_OVERVIEW; if (passed != mPassedOverviewThreshold) { if (passed != mPassedOverviewThreshold) { mPassedOverviewThreshold = passed; mPassedOverviewThreshold = passed; if (mDeviceState.isTwoButtonNavMode()) { if (mDeviceState.isTwoButtonNavMode() && !mGestureState.isHandlingAtomicEvent()) { performHapticFeedback(); performHapticFeedback(); } } } } Loading Loading @@ -854,7 +854,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, private GestureEndTarget calculateEndTarget(PointF velocity, float endVelocity, boolean isFling, private GestureEndTarget calculateEndTarget(PointF velocity, float endVelocity, boolean isFling, boolean isCancel) { boolean isCancel) { if (mDeviceState.isButtonNavMode()) { if (mGestureState.isHandlingAtomicEvent()) { // Button mode, this is only used to go to recents // Button mode, this is only used to go to recents return RECENTS; return RECENTS; } } Loading Loading @@ -979,7 +979,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, mRecentsView.snapToPage(mRecentsView.getNextPage(), (int) MAX_SWIPE_DURATION); mRecentsView.snapToPage(mRecentsView.getNextPage(), (int) MAX_SWIPE_DURATION); isScrolling = true; isScrolling = true; } } if (!mDeviceState.isButtonNavMode() || isScrolling) { if (!mGestureState.isHandlingAtomicEvent() || isScrolling) { duration = Math.max(duration, mRecentsView.getScroller().getDuration()); duration = Math.max(duration, mRecentsView.getScroller().getDuration()); } } } } Loading quickstep/src/com/android/quickstep/GestureState.java +18 −0 Original line number Original line Diff line number Diff line Loading @@ -146,6 +146,8 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL /** The time when the swipe up gesture is triggered. */ /** The time when the swipe up gesture is triggered. */ private long mSwipeUpStartTimeMs; private long mSwipeUpStartTimeMs; private boolean mHandlingAtomicEvent; public GestureState(OverviewComponentObserver componentObserver, int gestureId) { public GestureState(OverviewComponentObserver componentObserver, int gestureId) { mHomeIntent = componentObserver.getHomeIntent(); mHomeIntent = componentObserver.getHomeIntent(); mOverviewIntent = componentObserver.getOverviewIntent(); mOverviewIntent = componentObserver.getOverviewIntent(); Loading Loading @@ -314,6 +316,22 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL } } } } /** * Indicates if the gesture is handling an atomic event like a click and not a * user controlled gesture. */ public void setHandlingAtomicEvent(boolean handlingAtomicEvent) { mHandlingAtomicEvent = true; } /** * Returns true if the gesture is handling an atomic event like a click and not a * user controlled gesture. */ public boolean isHandlingAtomicEvent() { return mHandlingAtomicEvent; } /** /** * @return whether the current gesture is still running a recents animation to a state in the * @return whether the current gesture is still running a recents animation to a state in the * Launcher or Recents activity. * Launcher or Recents activity. Loading quickstep/src/com/android/quickstep/OverviewCommandHelper.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -179,6 +179,7 @@ public class OverviewCommandHelper { } } GestureState gestureState = mService.createGestureState(GestureState.DEFAULT_STATE); GestureState gestureState = mService.createGestureState(GestureState.DEFAULT_STATE); gestureState.setHandlingAtomicEvent(true); AbsSwipeUpHandler interactionHandler = mService.getSwipeUpHandlerFactory() AbsSwipeUpHandler interactionHandler = mService.getSwipeUpHandlerFactory() .newHandler(gestureState, cmd.createTime); .newHandler(gestureState, cmd.createTime); interactionHandler.setGestureEndCallback( interactionHandler.setGestureEndCallback( Loading Loading
quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -621,7 +621,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, final boolean passed = mCurrentShift.value >= MIN_PROGRESS_FOR_OVERVIEW; final boolean passed = mCurrentShift.value >= MIN_PROGRESS_FOR_OVERVIEW; if (passed != mPassedOverviewThreshold) { if (passed != mPassedOverviewThreshold) { mPassedOverviewThreshold = passed; mPassedOverviewThreshold = passed; if (mDeviceState.isTwoButtonNavMode()) { if (mDeviceState.isTwoButtonNavMode() && !mGestureState.isHandlingAtomicEvent()) { performHapticFeedback(); performHapticFeedback(); } } } } Loading Loading @@ -854,7 +854,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, private GestureEndTarget calculateEndTarget(PointF velocity, float endVelocity, boolean isFling, private GestureEndTarget calculateEndTarget(PointF velocity, float endVelocity, boolean isFling, boolean isCancel) { boolean isCancel) { if (mDeviceState.isButtonNavMode()) { if (mGestureState.isHandlingAtomicEvent()) { // Button mode, this is only used to go to recents // Button mode, this is only used to go to recents return RECENTS; return RECENTS; } } Loading Loading @@ -979,7 +979,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, mRecentsView.snapToPage(mRecentsView.getNextPage(), (int) MAX_SWIPE_DURATION); mRecentsView.snapToPage(mRecentsView.getNextPage(), (int) MAX_SWIPE_DURATION); isScrolling = true; isScrolling = true; } } if (!mDeviceState.isButtonNavMode() || isScrolling) { if (!mGestureState.isHandlingAtomicEvent() || isScrolling) { duration = Math.max(duration, mRecentsView.getScroller().getDuration()); duration = Math.max(duration, mRecentsView.getScroller().getDuration()); } } } } Loading
quickstep/src/com/android/quickstep/GestureState.java +18 −0 Original line number Original line Diff line number Diff line Loading @@ -146,6 +146,8 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL /** The time when the swipe up gesture is triggered. */ /** The time when the swipe up gesture is triggered. */ private long mSwipeUpStartTimeMs; private long mSwipeUpStartTimeMs; private boolean mHandlingAtomicEvent; public GestureState(OverviewComponentObserver componentObserver, int gestureId) { public GestureState(OverviewComponentObserver componentObserver, int gestureId) { mHomeIntent = componentObserver.getHomeIntent(); mHomeIntent = componentObserver.getHomeIntent(); mOverviewIntent = componentObserver.getOverviewIntent(); mOverviewIntent = componentObserver.getOverviewIntent(); Loading Loading @@ -314,6 +316,22 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL } } } } /** * Indicates if the gesture is handling an atomic event like a click and not a * user controlled gesture. */ public void setHandlingAtomicEvent(boolean handlingAtomicEvent) { mHandlingAtomicEvent = true; } /** * Returns true if the gesture is handling an atomic event like a click and not a * user controlled gesture. */ public boolean isHandlingAtomicEvent() { return mHandlingAtomicEvent; } /** /** * @return whether the current gesture is still running a recents animation to a state in the * @return whether the current gesture is still running a recents animation to a state in the * Launcher or Recents activity. * Launcher or Recents activity. Loading
quickstep/src/com/android/quickstep/OverviewCommandHelper.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -179,6 +179,7 @@ public class OverviewCommandHelper { } } GestureState gestureState = mService.createGestureState(GestureState.DEFAULT_STATE); GestureState gestureState = mService.createGestureState(GestureState.DEFAULT_STATE); gestureState.setHandlingAtomicEvent(true); AbsSwipeUpHandler interactionHandler = mService.getSwipeUpHandlerFactory() AbsSwipeUpHandler interactionHandler = mService.getSwipeUpHandlerFactory() .newHandler(gestureState, cmd.createTime); .newHandler(gestureState, cmd.createTime); interactionHandler.setGestureEndCallback( interactionHandler.setGestureEndCallback( Loading