Loading quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java +41 −26 Original line number Diff line number Diff line Loading @@ -38,9 +38,9 @@ import com.android.quickstep.RecentsAnimationCallbacks; import com.android.quickstep.RecentsAnimationCallbacks.RecentsAnimationListener; import com.android.quickstep.RecentsAnimationController; import com.android.quickstep.SystemUiProxy; import com.android.quickstep.views.RecentsView; import com.android.systemui.shared.recents.model.ThumbnailData; /** * A data source which integrates with a Launcher instance */ Loading Loading @@ -159,8 +159,7 @@ public class LauncherTaskbarUIController extends TaskbarUIController { * automatically reset once the recents animation finishes */ public Animator createAnimToLauncher(@NonNull LauncherState toState, @NonNull RecentsAnimationCallbacks callbacks, long duration) { @NonNull RecentsAnimationCallbacks callbacks, long duration) { TaskbarStashController stashController = mControllers.taskbarStashController; ObjectAnimator animator = mIconAlignmentForGestureState .animateToValue(1) Loading @@ -180,31 +179,15 @@ public class LauncherTaskbarUIController extends TaskbarUIController { stashController.animateToIsStashed(false, duration); } }); callbacks.addListener(new RecentsAnimationListener() { @Override public void onRecentsAnimationCanceled(ThumbnailData thumbnailData) { endGestureStateOverride(true); } @Override public void onRecentsAnimationFinished(RecentsAnimationController controller) { endGestureStateOverride(!controller.getFinishTargetIsLauncher()); } private void endGestureStateOverride(boolean finishedToApp) { callbacks.removeListener(this); mIsAnimatingToLauncherViaGesture = false; mIconAlignmentForGestureState .animateToValue(0) .start(); if (finishedToApp) { // We only need this for the exiting live tile case. stashController.animateToIsStashed(stashController.isStashedInApp()); } } TaskBarRecentsAnimationListener listener = new TaskBarRecentsAnimationListener(callbacks); callbacks.addListener(listener); RecentsView recentsView = mLauncher.getOverviewPanel(); recentsView.setTaskLaunchListener(() -> { listener.endGestureStateOverride(true); callbacks.removeListener(listener); }); return animator; } Loading Loading @@ -249,4 +232,36 @@ public class LauncherTaskbarUIController extends TaskbarUIController { mIconAlphaForHome.setValue(isVisible ? 1 : 0); mLauncher.getHotseat().setIconsAlpha(isVisible ? 0f : 1f); } private final class TaskBarRecentsAnimationListener implements RecentsAnimationListener { private final RecentsAnimationCallbacks mCallbacks; TaskBarRecentsAnimationListener(RecentsAnimationCallbacks callbacks) { mCallbacks = callbacks; } @Override public void onRecentsAnimationCanceled(ThumbnailData thumbnailData) { endGestureStateOverride(true); } @Override public void onRecentsAnimationFinished(RecentsAnimationController controller) { endGestureStateOverride(!controller.getFinishTargetIsLauncher()); } private void endGestureStateOverride(boolean finishedToApp) { mCallbacks.removeListener(this); mIsAnimatingToLauncherViaGesture = false; mIconAlignmentForGestureState .animateToValue(0) .start(); TaskbarStashController controller = mControllers.taskbarStashController; if (finishedToApp) { controller.animateToIsStashed(controller.isStashedInApp()); } } } } quickstep/src/com/android/quickstep/views/RecentsView.java +20 −0 Original line number Diff line number Diff line Loading @@ -602,6 +602,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T }; private RunnableList mSideTaskLaunchCallback; private TaskLaunchListener mTaskLaunchListener; public RecentsView(Context context, AttributeSet attrs, int defStyleAttr, BaseActivityInterface sizeStrategy) { Loading Loading @@ -882,6 +883,21 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T mSideTaskLaunchCallback.add(callback::executeAllAndDestroy); } /** * This is a one-time callback when touching in live tile mode. It's reset to null right * after it's called. */ public void setTaskLaunchListener(TaskLaunchListener taskLaunchListener) { mTaskLaunchListener = taskLaunchListener; } public void onTaskLaunchedInLiveTileMode() { if (mTaskLaunchListener != null) { mTaskLaunchListener.onTaskLaunched(); mTaskLaunchListener = null; } } private void executeSideTaskLaunchCallback() { if (mSideTaskLaunchCallback != null) { mSideTaskLaunchCallback.executeAllAndDestroy(); Loading Loading @@ -4210,4 +4226,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T // Set locus context is a binder call, don't want it to happen during a transition UI_HELPER_EXECUTOR.post(() -> mActivity.setLocusContext(id, Bundle.EMPTY)); } public interface TaskLaunchListener { void onTaskLaunched(); } } quickstep/src/com/android/quickstep/views/TaskView.java +6 −3 Original line number Diff line number Diff line Loading @@ -584,6 +584,7 @@ public class TaskView extends FrameLayout implements Reusable { } }); anim.start(); recentsView.onTaskLaunchedInLiveTileMode(); } else { launchTaskAnimated(); } Loading Loading @@ -614,12 +615,14 @@ public class TaskView extends FrameLayout implements Reusable { ActivityOptionsWrapper opts = mActivity.getActivityLaunchOptions(this, null); if (ActivityManagerWrapper.getInstance() .startActivityFromRecents(mTask.key, opts.options)) { if (ENABLE_QUICKSTEP_LIVE_TILE.get() && getRecentsView().getRunningTaskViewId() != -1) { RecentsView recentsView = getRecentsView(); if (ENABLE_QUICKSTEP_LIVE_TILE.get() && recentsView.getRunningTaskViewId() != -1) { recentsView.onTaskLaunchedInLiveTileMode(); // Return a fresh callback in the live tile case, so that it's not accidentally // triggered by QuickstepTransitionManager.AppLaunchAnimationRunner. RunnableList callbackList = new RunnableList(); getRecentsView().addSideTaskLaunchCallback(callbackList); recentsView.addSideTaskLaunchCallback(callbackList); return callbackList; } return opts.onEndCallback; Loading Loading
quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java +41 −26 Original line number Diff line number Diff line Loading @@ -38,9 +38,9 @@ import com.android.quickstep.RecentsAnimationCallbacks; import com.android.quickstep.RecentsAnimationCallbacks.RecentsAnimationListener; import com.android.quickstep.RecentsAnimationController; import com.android.quickstep.SystemUiProxy; import com.android.quickstep.views.RecentsView; import com.android.systemui.shared.recents.model.ThumbnailData; /** * A data source which integrates with a Launcher instance */ Loading Loading @@ -159,8 +159,7 @@ public class LauncherTaskbarUIController extends TaskbarUIController { * automatically reset once the recents animation finishes */ public Animator createAnimToLauncher(@NonNull LauncherState toState, @NonNull RecentsAnimationCallbacks callbacks, long duration) { @NonNull RecentsAnimationCallbacks callbacks, long duration) { TaskbarStashController stashController = mControllers.taskbarStashController; ObjectAnimator animator = mIconAlignmentForGestureState .animateToValue(1) Loading @@ -180,31 +179,15 @@ public class LauncherTaskbarUIController extends TaskbarUIController { stashController.animateToIsStashed(false, duration); } }); callbacks.addListener(new RecentsAnimationListener() { @Override public void onRecentsAnimationCanceled(ThumbnailData thumbnailData) { endGestureStateOverride(true); } @Override public void onRecentsAnimationFinished(RecentsAnimationController controller) { endGestureStateOverride(!controller.getFinishTargetIsLauncher()); } private void endGestureStateOverride(boolean finishedToApp) { callbacks.removeListener(this); mIsAnimatingToLauncherViaGesture = false; mIconAlignmentForGestureState .animateToValue(0) .start(); if (finishedToApp) { // We only need this for the exiting live tile case. stashController.animateToIsStashed(stashController.isStashedInApp()); } } TaskBarRecentsAnimationListener listener = new TaskBarRecentsAnimationListener(callbacks); callbacks.addListener(listener); RecentsView recentsView = mLauncher.getOverviewPanel(); recentsView.setTaskLaunchListener(() -> { listener.endGestureStateOverride(true); callbacks.removeListener(listener); }); return animator; } Loading Loading @@ -249,4 +232,36 @@ public class LauncherTaskbarUIController extends TaskbarUIController { mIconAlphaForHome.setValue(isVisible ? 1 : 0); mLauncher.getHotseat().setIconsAlpha(isVisible ? 0f : 1f); } private final class TaskBarRecentsAnimationListener implements RecentsAnimationListener { private final RecentsAnimationCallbacks mCallbacks; TaskBarRecentsAnimationListener(RecentsAnimationCallbacks callbacks) { mCallbacks = callbacks; } @Override public void onRecentsAnimationCanceled(ThumbnailData thumbnailData) { endGestureStateOverride(true); } @Override public void onRecentsAnimationFinished(RecentsAnimationController controller) { endGestureStateOverride(!controller.getFinishTargetIsLauncher()); } private void endGestureStateOverride(boolean finishedToApp) { mCallbacks.removeListener(this); mIsAnimatingToLauncherViaGesture = false; mIconAlignmentForGestureState .animateToValue(0) .start(); TaskbarStashController controller = mControllers.taskbarStashController; if (finishedToApp) { controller.animateToIsStashed(controller.isStashedInApp()); } } } }
quickstep/src/com/android/quickstep/views/RecentsView.java +20 −0 Original line number Diff line number Diff line Loading @@ -602,6 +602,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T }; private RunnableList mSideTaskLaunchCallback; private TaskLaunchListener mTaskLaunchListener; public RecentsView(Context context, AttributeSet attrs, int defStyleAttr, BaseActivityInterface sizeStrategy) { Loading Loading @@ -882,6 +883,21 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T mSideTaskLaunchCallback.add(callback::executeAllAndDestroy); } /** * This is a one-time callback when touching in live tile mode. It's reset to null right * after it's called. */ public void setTaskLaunchListener(TaskLaunchListener taskLaunchListener) { mTaskLaunchListener = taskLaunchListener; } public void onTaskLaunchedInLiveTileMode() { if (mTaskLaunchListener != null) { mTaskLaunchListener.onTaskLaunched(); mTaskLaunchListener = null; } } private void executeSideTaskLaunchCallback() { if (mSideTaskLaunchCallback != null) { mSideTaskLaunchCallback.executeAllAndDestroy(); Loading Loading @@ -4210,4 +4226,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T // Set locus context is a binder call, don't want it to happen during a transition UI_HELPER_EXECUTOR.post(() -> mActivity.setLocusContext(id, Bundle.EMPTY)); } public interface TaskLaunchListener { void onTaskLaunched(); } }
quickstep/src/com/android/quickstep/views/TaskView.java +6 −3 Original line number Diff line number Diff line Loading @@ -584,6 +584,7 @@ public class TaskView extends FrameLayout implements Reusable { } }); anim.start(); recentsView.onTaskLaunchedInLiveTileMode(); } else { launchTaskAnimated(); } Loading Loading @@ -614,12 +615,14 @@ public class TaskView extends FrameLayout implements Reusable { ActivityOptionsWrapper opts = mActivity.getActivityLaunchOptions(this, null); if (ActivityManagerWrapper.getInstance() .startActivityFromRecents(mTask.key, opts.options)) { if (ENABLE_QUICKSTEP_LIVE_TILE.get() && getRecentsView().getRunningTaskViewId() != -1) { RecentsView recentsView = getRecentsView(); if (ENABLE_QUICKSTEP_LIVE_TILE.get() && recentsView.getRunningTaskViewId() != -1) { recentsView.onTaskLaunchedInLiveTileMode(); // Return a fresh callback in the live tile case, so that it's not accidentally // triggered by QuickstepTransitionManager.AppLaunchAnimationRunner. RunnableList callbackList = new RunnableList(); getRecentsView().addSideTaskLaunchCallback(callbackList); recentsView.addSideTaskLaunchCallback(callbackList); return callbackList; } return opts.onEndCallback; Loading