Loading quickstep/src/com/android/launcher3/uioverrides/IgnoreTouchesInQuickScrub.java +3 −8 Original line number Diff line number Diff line Loading @@ -18,20 +18,15 @@ package com.android.launcher3.uioverrides; import android.view.MotionEvent; import com.android.launcher3.Launcher; import com.android.launcher3.util.TouchController; import com.android.quickstep.QuickScrubController; import com.android.quickstep.RecentsView; import com.android.quickstep.TouchInteractionService; /** * Consumes touches when quick scrub is enabled. */ public class IgnoreTouchesInQuickScrub implements TouchController { private QuickScrubController mQuickScrubController; public IgnoreTouchesInQuickScrub(Launcher l) { mQuickScrubController = ((RecentsView) l.getOverviewPanel()).getQuickScrubController(); public IgnoreTouchesInQuickScrub() { } @Override Loading @@ -41,6 +36,6 @@ public class IgnoreTouchesInQuickScrub implements TouchController { @Override public boolean onControllerInterceptTouchEvent(MotionEvent ev) { return mQuickScrubController.isQuickScrubEnabled(); return TouchInteractionService.isQuickScrubEnabled(); } } quickstep/src/com/android/launcher3/uioverrides/UiFactory.java +2 −2 Original line number Diff line number Diff line Loading @@ -43,13 +43,13 @@ public class UiFactory { public static TouchController[] createTouchControllers(Launcher launcher) { if (FeatureFlags.ENABLE_TWO_SWIPE_TARGETS) { return new TouchController[] { new IgnoreTouchesInQuickScrub(launcher), new IgnoreTouchesInQuickScrub(), new EdgeSwipeController(launcher), new TwoStepSwipeController(launcher), new OverviewSwipeController(launcher)}; } else { return new TouchController[] { new IgnoreTouchesInQuickScrub(launcher), new IgnoreTouchesInQuickScrub(), new TwoStepSwipeController(launcher), new OverviewSwipeController(launcher)}; } Loading quickstep/src/com/android/quickstep/QuickScrubController.java +0 −8 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ public class QuickScrubController implements OnAlarmListener { private int mQuickScrubSection; private int mStartPage; private boolean mQuickScrubEnabled; public QuickScrubController(Launcher launcher) { mLauncher = launcher; Loading @@ -52,13 +51,11 @@ public class QuickScrubController implements OnAlarmListener { mRecentsView = mLauncher.getOverviewPanel(); mStartPage = startingFromHome ? 0 : mRecentsView.getFirstTaskIndex(); mQuickScrubSection = 0; mQuickScrubEnabled = true; } public void onQuickScrubEnd() { mAutoAdvanceAlarm.cancelAlarm(); if (mRecentsView == null) { mQuickScrubEnabled = false; } else { int page = mRecentsView.getNextPage(); // Settle on the page then launch it. Loading @@ -71,15 +68,10 @@ public class QuickScrubController implements OnAlarmListener { } else { ((TaskView) mRecentsView.getPageAt(page)).launchTask(true); } mQuickScrubEnabled = false; }, snapDuration); } } public boolean isQuickScrubEnabled() { return mQuickScrubEnabled; } public void onQuickScrubProgress(float progress) { int quickScrubSection = Math.round(progress * NUM_QUICK_SCRUB_SECTIONS); if (quickScrubSection != mQuickScrubSection) { Loading quickstep/src/com/android/quickstep/TouchInteractionService.java +7 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ public class TouchInteractionService extends Service { @Override public void onQuickScrubStart() { startTouchTracking(INTERACTION_QUICK_SCRUB); sQuickScrubEnabled = true; } @Override Loading @@ -114,6 +115,7 @@ public class TouchInteractionService extends Service { mInteractionHandler.onQuickScrubEnd(); mInteractionHandler = null; } sQuickScrubEnabled = false; } @Override Loading @@ -129,11 +131,16 @@ public class TouchInteractionService extends Service { private final Consumer<MotionEvent> mNoOpTouchConsumer = (ev) -> {}; private static boolean sConnected = false; private static boolean sQuickScrubEnabled = false; public static boolean isConnected() { return sConnected; } public static boolean isQuickScrubEnabled() { return sQuickScrubEnabled; } private ActivityManagerWrapper mAM; private RunningTaskInfo mRunningTask; private RecentsModel mRecentsModel; Loading Loading
quickstep/src/com/android/launcher3/uioverrides/IgnoreTouchesInQuickScrub.java +3 −8 Original line number Diff line number Diff line Loading @@ -18,20 +18,15 @@ package com.android.launcher3.uioverrides; import android.view.MotionEvent; import com.android.launcher3.Launcher; import com.android.launcher3.util.TouchController; import com.android.quickstep.QuickScrubController; import com.android.quickstep.RecentsView; import com.android.quickstep.TouchInteractionService; /** * Consumes touches when quick scrub is enabled. */ public class IgnoreTouchesInQuickScrub implements TouchController { private QuickScrubController mQuickScrubController; public IgnoreTouchesInQuickScrub(Launcher l) { mQuickScrubController = ((RecentsView) l.getOverviewPanel()).getQuickScrubController(); public IgnoreTouchesInQuickScrub() { } @Override Loading @@ -41,6 +36,6 @@ public class IgnoreTouchesInQuickScrub implements TouchController { @Override public boolean onControllerInterceptTouchEvent(MotionEvent ev) { return mQuickScrubController.isQuickScrubEnabled(); return TouchInteractionService.isQuickScrubEnabled(); } }
quickstep/src/com/android/launcher3/uioverrides/UiFactory.java +2 −2 Original line number Diff line number Diff line Loading @@ -43,13 +43,13 @@ public class UiFactory { public static TouchController[] createTouchControllers(Launcher launcher) { if (FeatureFlags.ENABLE_TWO_SWIPE_TARGETS) { return new TouchController[] { new IgnoreTouchesInQuickScrub(launcher), new IgnoreTouchesInQuickScrub(), new EdgeSwipeController(launcher), new TwoStepSwipeController(launcher), new OverviewSwipeController(launcher)}; } else { return new TouchController[] { new IgnoreTouchesInQuickScrub(launcher), new IgnoreTouchesInQuickScrub(), new TwoStepSwipeController(launcher), new OverviewSwipeController(launcher)}; } Loading
quickstep/src/com/android/quickstep/QuickScrubController.java +0 −8 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ public class QuickScrubController implements OnAlarmListener { private int mQuickScrubSection; private int mStartPage; private boolean mQuickScrubEnabled; public QuickScrubController(Launcher launcher) { mLauncher = launcher; Loading @@ -52,13 +51,11 @@ public class QuickScrubController implements OnAlarmListener { mRecentsView = mLauncher.getOverviewPanel(); mStartPage = startingFromHome ? 0 : mRecentsView.getFirstTaskIndex(); mQuickScrubSection = 0; mQuickScrubEnabled = true; } public void onQuickScrubEnd() { mAutoAdvanceAlarm.cancelAlarm(); if (mRecentsView == null) { mQuickScrubEnabled = false; } else { int page = mRecentsView.getNextPage(); // Settle on the page then launch it. Loading @@ -71,15 +68,10 @@ public class QuickScrubController implements OnAlarmListener { } else { ((TaskView) mRecentsView.getPageAt(page)).launchTask(true); } mQuickScrubEnabled = false; }, snapDuration); } } public boolean isQuickScrubEnabled() { return mQuickScrubEnabled; } public void onQuickScrubProgress(float progress) { int quickScrubSection = Math.round(progress * NUM_QUICK_SCRUB_SECTIONS); if (quickScrubSection != mQuickScrubSection) { Loading
quickstep/src/com/android/quickstep/TouchInteractionService.java +7 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ public class TouchInteractionService extends Service { @Override public void onQuickScrubStart() { startTouchTracking(INTERACTION_QUICK_SCRUB); sQuickScrubEnabled = true; } @Override Loading @@ -114,6 +115,7 @@ public class TouchInteractionService extends Service { mInteractionHandler.onQuickScrubEnd(); mInteractionHandler = null; } sQuickScrubEnabled = false; } @Override Loading @@ -129,11 +131,16 @@ public class TouchInteractionService extends Service { private final Consumer<MotionEvent> mNoOpTouchConsumer = (ev) -> {}; private static boolean sConnected = false; private static boolean sQuickScrubEnabled = false; public static boolean isConnected() { return sConnected; } public static boolean isQuickScrubEnabled() { return sQuickScrubEnabled; } private ActivityManagerWrapper mAM; private RunningTaskInfo mRunningTask; private RecentsModel mRecentsModel; Loading