Loading quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java +23 −11 Original line number Diff line number Diff line Loading @@ -304,6 +304,10 @@ public class TaskbarLauncherStateController { callbacks.addListener(mTaskBarRecentsAnimationListener); ((RecentsView) mLauncher.getOverviewPanel()).setTaskLaunchListener(() -> mTaskBarRecentsAnimationListener.endGestureStateOverride(true)); ((RecentsView) mLauncher.getOverviewPanel()).setTaskLaunchCancelledRunnable(() -> { updateStateForUserFinishedToApp(false /* finishedToApp */); }); return animatorSet; } Loading Loading @@ -770,6 +774,15 @@ public class TaskbarLauncherStateController { mTaskBarRecentsAnimationListener = null; ((RecentsView) mLauncher.getOverviewPanel()).setTaskLaunchListener(null); updateStateForUserFinishedToApp(finishedToApp); } } /** * Updates the visible state immediately to ensure a seamless handoff. * @param finishedToApp True iff user is in an app. */ private void updateStateForUserFinishedToApp(boolean finishedToApp) { // Update the visible state immediately to ensure a seamless handoff boolean launcherVisible = !finishedToApp; updateStateForFlag(FLAG_TRANSITION_TO_VISIBLE, false); Loading @@ -783,7 +796,6 @@ public class TaskbarLauncherStateController { controller.updateStateForFlag(FLAG_IN_APP, finishedToApp); controller.applyState(); } } private static String getStateString(int flags) { StringJoiner result = new StringJoiner("|"); Loading quickstep/src/com/android/quickstep/TaskViewUtils.java +12 −0 Original line number Diff line number Diff line Loading @@ -646,6 +646,18 @@ public final class TaskViewUtils { }); }); } @Override public void onAnimationCancel(Animator animation) { super.onAnimationCancel(animation); recentsView.onTaskLaunchedInLiveTileModeCancelled(); } @Override public void onAnimationEnd(Animator animation) { super.onAnimationEnd(animation); recentsView.setTaskLaunchCancelledRunnable(null); } }; } else { AnimatorPlaybackController controller = Loading quickstep/src/com/android/quickstep/views/RecentsView.java +18 −0 Original line number Diff line number Diff line Loading @@ -759,6 +759,9 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T private RunnableList mSideTaskLaunchCallback; @Nullable private TaskLaunchListener mTaskLaunchListener; @Nullable private Runnable mOnTaskLaunchCancelledRunnable; // keeps track of the state of the filter for tasks in recents view private final RecentsFilterState mFilterState = new RecentsFilterState(); Loading Loading @@ -1195,6 +1198,21 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T } } /** * This is a one-time callback when touching in live tile mode. It's reset to null right * after it's called. */ public void setTaskLaunchCancelledRunnable(Runnable onTaskLaunchCancelledRunnable) { mOnTaskLaunchCancelledRunnable = onTaskLaunchCancelledRunnable; } public void onTaskLaunchedInLiveTileModeCancelled() { if (mOnTaskLaunchCancelledRunnable != null) { mOnTaskLaunchCancelledRunnable.run(); mOnTaskLaunchCancelledRunnable = null; } } private void executeSideTaskLaunchCallback() { if (mSideTaskLaunchCallback != null) { mSideTaskLaunchCallback.executeAllAndDestroy(); Loading Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java +23 −11 Original line number Diff line number Diff line Loading @@ -304,6 +304,10 @@ public class TaskbarLauncherStateController { callbacks.addListener(mTaskBarRecentsAnimationListener); ((RecentsView) mLauncher.getOverviewPanel()).setTaskLaunchListener(() -> mTaskBarRecentsAnimationListener.endGestureStateOverride(true)); ((RecentsView) mLauncher.getOverviewPanel()).setTaskLaunchCancelledRunnable(() -> { updateStateForUserFinishedToApp(false /* finishedToApp */); }); return animatorSet; } Loading Loading @@ -770,6 +774,15 @@ public class TaskbarLauncherStateController { mTaskBarRecentsAnimationListener = null; ((RecentsView) mLauncher.getOverviewPanel()).setTaskLaunchListener(null); updateStateForUserFinishedToApp(finishedToApp); } } /** * Updates the visible state immediately to ensure a seamless handoff. * @param finishedToApp True iff user is in an app. */ private void updateStateForUserFinishedToApp(boolean finishedToApp) { // Update the visible state immediately to ensure a seamless handoff boolean launcherVisible = !finishedToApp; updateStateForFlag(FLAG_TRANSITION_TO_VISIBLE, false); Loading @@ -783,7 +796,6 @@ public class TaskbarLauncherStateController { controller.updateStateForFlag(FLAG_IN_APP, finishedToApp); controller.applyState(); } } private static String getStateString(int flags) { StringJoiner result = new StringJoiner("|"); Loading
quickstep/src/com/android/quickstep/TaskViewUtils.java +12 −0 Original line number Diff line number Diff line Loading @@ -646,6 +646,18 @@ public final class TaskViewUtils { }); }); } @Override public void onAnimationCancel(Animator animation) { super.onAnimationCancel(animation); recentsView.onTaskLaunchedInLiveTileModeCancelled(); } @Override public void onAnimationEnd(Animator animation) { super.onAnimationEnd(animation); recentsView.setTaskLaunchCancelledRunnable(null); } }; } else { AnimatorPlaybackController controller = Loading
quickstep/src/com/android/quickstep/views/RecentsView.java +18 −0 Original line number Diff line number Diff line Loading @@ -759,6 +759,9 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T private RunnableList mSideTaskLaunchCallback; @Nullable private TaskLaunchListener mTaskLaunchListener; @Nullable private Runnable mOnTaskLaunchCancelledRunnable; // keeps track of the state of the filter for tasks in recents view private final RecentsFilterState mFilterState = new RecentsFilterState(); Loading Loading @@ -1195,6 +1198,21 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T } } /** * This is a one-time callback when touching in live tile mode. It's reset to null right * after it's called. */ public void setTaskLaunchCancelledRunnable(Runnable onTaskLaunchCancelledRunnable) { mOnTaskLaunchCancelledRunnable = onTaskLaunchCancelledRunnable; } public void onTaskLaunchedInLiveTileModeCancelled() { if (mOnTaskLaunchCancelledRunnable != null) { mOnTaskLaunchCancelledRunnable.run(); mOnTaskLaunchCancelledRunnable = null; } } private void executeSideTaskLaunchCallback() { if (mSideTaskLaunchCallback != null) { mSideTaskLaunchCallback.executeAllAndDestroy(); Loading