Loading quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java +6 −3 Original line number Diff line number Diff line Loading @@ -88,6 +88,7 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch private ObjectAnimator mNormalToHintOverviewScrimAnimator; private final QuickstepLauncher mLauncher; private boolean mIsTrackpadSwipe; /** * @param cancelSplitRunnable Called when split placeholder view needs to be cancelled. Loading @@ -106,9 +107,9 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch @Override protected boolean canInterceptTouch(MotionEvent ev) { boolean isTrackpadEvent = isTrackpadMotionEvent(ev); mLauncher.setCanShowAllAppsEducationView(!isTrackpadEvent); if (!isTrackpadEvent && DisplayController.getNavigationMode(mLauncher) mIsTrackpadSwipe = isTrackpadMotionEvent(ev); mLauncher.setCanShowAllAppsEducationView(!mIsTrackpadSwipe); if (!mIsTrackpadSwipe && DisplayController.getNavigationMode(mLauncher) == THREE_BUTTONS) { return false; } Loading Loading @@ -152,6 +153,7 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch super.onDragStart(start, startDisplacement); mMotionPauseDetector.clear(); mMotionPauseDetector.setIsTrackpadGesture(mIsTrackpadSwipe); if (handlingOverviewAnim()) { InteractionJankMonitorWrapper.begin(mRecentsView, Cuj.CUJ_LAUNCHER_APP_SWIPE_TO_RECENTS, Loading Loading @@ -195,6 +197,7 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch } mMotionPauseDetector.clear(); mIsTrackpadSwipe = false; mNormalToHintOverviewScrimAnimator = null; if (mLauncher.isInState(OVERVIEW)) { // Normally we would cleanup the state based on mCurrentAnimation, but since we stop Loading quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java +4 −1 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ public class NoButtonQuickSwitchTouchController implements TouchController, private AnimatorPlaybackController mNonOverviewAnim; private AnimatorPlaybackController mXOverviewAnim; private AnimatedFloat mYOverviewAnim; private boolean mIsTrackpadSwipe; public NoButtonQuickSwitchTouchController(QuickstepLauncher launcher) { mLauncher = launcher; Loading Loading @@ -177,7 +178,8 @@ public class NoButtonQuickSwitchTouchController implements TouchController, return false; } if (isTrackpadMultiFingerSwipe(ev)) { return isTrackpadFourFingerSwipe(ev); mIsTrackpadSwipe = isTrackpadFourFingerSwipe(ev); return mIsTrackpadSwipe; } return true; } Loading @@ -185,6 +187,7 @@ public class NoButtonQuickSwitchTouchController implements TouchController, @Override public void onDragStart(boolean start) { mMotionPauseDetector.clear(); mMotionPauseDetector.setIsTrackpadGesture(mIsTrackpadSwipe); if (start) { InteractionJankMonitorWrapper.begin(mRecentsView, Cuj.CUJ_LAUNCHER_QUICK_SWITCH); InteractionJankMonitorWrapper.begin(mRecentsView, Cuj.CUJ_LAUNCHER_APP_SWIPE_TO_RECENTS, Loading quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java +1 −0 Original line number Diff line number Diff line Loading @@ -409,6 +409,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC mInteractionHandler = mHandlerFactory.newHandler(mGestureState, touchTimeMs); mInteractionHandler.setGestureEndCallback(this::onInteractionGestureFinished); mMotionPauseDetector.setOnMotionPauseListener(mInteractionHandler.getMotionPauseListener()); mMotionPauseDetector.setIsTrackpadGesture(mGestureState.isTrackpadGesture()); mInteractionHandler.initWhenReady( "OtherActivityInputConsumer.startTouchTrackingForWindowAnimation"); Loading quickstep/src/com/android/quickstep/util/MotionPauseDetector.java +14 −1 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ public class MotionPauseDetector { private Float mPreviousVelocity = null; private OnMotionPauseListener mOnMotionPauseListener; private boolean mIsTrackpadGesture; private boolean mIsPaused; // Bias more for the first pause to make it feel extra responsive. private boolean mHasEverBeenPaused; Loading Loading @@ -115,6 +116,10 @@ public class MotionPauseDetector { mOnMotionPauseListener = listener; } public void setIsTrackpadGesture(boolean isTrackpadGesture) { mIsTrackpadGesture = isTrackpadGesture; } /** * @param disallowPause If true, we will not detect any pauses until this is set to false again. */ Loading Loading @@ -179,7 +184,8 @@ public class MotionPauseDetector { // We want to be more aggressive about detecting the first pause to ensure it // feels as responsive as possible; getting two very slow speeds back to back // takes too long, so also check for a rapid deceleration. boolean isRapidDeceleration = speed < previousSpeed * RAPID_DECELERATION_FACTOR; boolean isRapidDeceleration = speed < previousSpeed * getRapidDecelerationFactor(); isPaused = isRapidDeceleration && speed < mSpeedSomewhatFast; isPausedReason = new ActiveGestureLog.CompoundString( "Didn't have back to back slow speeds, checking for rapid ") Loading Loading @@ -253,6 +259,7 @@ public class MotionPauseDetector { mVelocityProvider.clear(); mPreviousVelocity = null; setOnMotionPauseListener(null); mIsTrackpadGesture = false; mIsPaused = mHasEverBeenPaused = false; mSlowStartTime = 0; mForcePauseTimeout.cancelAlarm(); Loading @@ -262,6 +269,12 @@ public class MotionPauseDetector { return mIsPaused; } private float getRapidDecelerationFactor() { return mIsTrackpadGesture ? Float.parseFloat( Utilities.getSystemProperty("trackpad_in_app_swipe_up_deceleration_factor", String.valueOf(RAPID_DECELERATION_FACTOR))) : RAPID_DECELERATION_FACTOR; } public interface OnMotionPauseListener { /** Called only the first time motion pause is detected. */ void onMotionPauseDetected(); Loading Loading
quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java +6 −3 Original line number Diff line number Diff line Loading @@ -88,6 +88,7 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch private ObjectAnimator mNormalToHintOverviewScrimAnimator; private final QuickstepLauncher mLauncher; private boolean mIsTrackpadSwipe; /** * @param cancelSplitRunnable Called when split placeholder view needs to be cancelled. Loading @@ -106,9 +107,9 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch @Override protected boolean canInterceptTouch(MotionEvent ev) { boolean isTrackpadEvent = isTrackpadMotionEvent(ev); mLauncher.setCanShowAllAppsEducationView(!isTrackpadEvent); if (!isTrackpadEvent && DisplayController.getNavigationMode(mLauncher) mIsTrackpadSwipe = isTrackpadMotionEvent(ev); mLauncher.setCanShowAllAppsEducationView(!mIsTrackpadSwipe); if (!mIsTrackpadSwipe && DisplayController.getNavigationMode(mLauncher) == THREE_BUTTONS) { return false; } Loading Loading @@ -152,6 +153,7 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch super.onDragStart(start, startDisplacement); mMotionPauseDetector.clear(); mMotionPauseDetector.setIsTrackpadGesture(mIsTrackpadSwipe); if (handlingOverviewAnim()) { InteractionJankMonitorWrapper.begin(mRecentsView, Cuj.CUJ_LAUNCHER_APP_SWIPE_TO_RECENTS, Loading Loading @@ -195,6 +197,7 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch } mMotionPauseDetector.clear(); mIsTrackpadSwipe = false; mNormalToHintOverviewScrimAnimator = null; if (mLauncher.isInState(OVERVIEW)) { // Normally we would cleanup the state based on mCurrentAnimation, but since we stop Loading
quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java +4 −1 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ public class NoButtonQuickSwitchTouchController implements TouchController, private AnimatorPlaybackController mNonOverviewAnim; private AnimatorPlaybackController mXOverviewAnim; private AnimatedFloat mYOverviewAnim; private boolean mIsTrackpadSwipe; public NoButtonQuickSwitchTouchController(QuickstepLauncher launcher) { mLauncher = launcher; Loading Loading @@ -177,7 +178,8 @@ public class NoButtonQuickSwitchTouchController implements TouchController, return false; } if (isTrackpadMultiFingerSwipe(ev)) { return isTrackpadFourFingerSwipe(ev); mIsTrackpadSwipe = isTrackpadFourFingerSwipe(ev); return mIsTrackpadSwipe; } return true; } Loading @@ -185,6 +187,7 @@ public class NoButtonQuickSwitchTouchController implements TouchController, @Override public void onDragStart(boolean start) { mMotionPauseDetector.clear(); mMotionPauseDetector.setIsTrackpadGesture(mIsTrackpadSwipe); if (start) { InteractionJankMonitorWrapper.begin(mRecentsView, Cuj.CUJ_LAUNCHER_QUICK_SWITCH); InteractionJankMonitorWrapper.begin(mRecentsView, Cuj.CUJ_LAUNCHER_APP_SWIPE_TO_RECENTS, Loading
quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java +1 −0 Original line number Diff line number Diff line Loading @@ -409,6 +409,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC mInteractionHandler = mHandlerFactory.newHandler(mGestureState, touchTimeMs); mInteractionHandler.setGestureEndCallback(this::onInteractionGestureFinished); mMotionPauseDetector.setOnMotionPauseListener(mInteractionHandler.getMotionPauseListener()); mMotionPauseDetector.setIsTrackpadGesture(mGestureState.isTrackpadGesture()); mInteractionHandler.initWhenReady( "OtherActivityInputConsumer.startTouchTrackingForWindowAnimation"); Loading
quickstep/src/com/android/quickstep/util/MotionPauseDetector.java +14 −1 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ public class MotionPauseDetector { private Float mPreviousVelocity = null; private OnMotionPauseListener mOnMotionPauseListener; private boolean mIsTrackpadGesture; private boolean mIsPaused; // Bias more for the first pause to make it feel extra responsive. private boolean mHasEverBeenPaused; Loading Loading @@ -115,6 +116,10 @@ public class MotionPauseDetector { mOnMotionPauseListener = listener; } public void setIsTrackpadGesture(boolean isTrackpadGesture) { mIsTrackpadGesture = isTrackpadGesture; } /** * @param disallowPause If true, we will not detect any pauses until this is set to false again. */ Loading Loading @@ -179,7 +184,8 @@ public class MotionPauseDetector { // We want to be more aggressive about detecting the first pause to ensure it // feels as responsive as possible; getting two very slow speeds back to back // takes too long, so also check for a rapid deceleration. boolean isRapidDeceleration = speed < previousSpeed * RAPID_DECELERATION_FACTOR; boolean isRapidDeceleration = speed < previousSpeed * getRapidDecelerationFactor(); isPaused = isRapidDeceleration && speed < mSpeedSomewhatFast; isPausedReason = new ActiveGestureLog.CompoundString( "Didn't have back to back slow speeds, checking for rapid ") Loading Loading @@ -253,6 +259,7 @@ public class MotionPauseDetector { mVelocityProvider.clear(); mPreviousVelocity = null; setOnMotionPauseListener(null); mIsTrackpadGesture = false; mIsPaused = mHasEverBeenPaused = false; mSlowStartTime = 0; mForcePauseTimeout.cancelAlarm(); Loading @@ -262,6 +269,12 @@ public class MotionPauseDetector { return mIsPaused; } private float getRapidDecelerationFactor() { return mIsTrackpadGesture ? Float.parseFloat( Utilities.getSystemProperty("trackpad_in_app_swipe_up_deceleration_factor", String.valueOf(RAPID_DECELERATION_FACTOR))) : RAPID_DECELERATION_FACTOR; } public interface OnMotionPauseListener { /** Called only the first time motion pause is detected. */ void onMotionPauseDetected(); Loading