Loading quickstep/src/com/android/quickstep/util/SplitSelectStateController.java +24 −13 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.quickstep.util; import static com.android.launcher3.Utilities.postAsyncCallback; import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_DESKTOP_TO_WORKSPACE; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_DESKTOP_MODE_SPLIT_LEFT_TOP; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_DESKTOP_MODE_SPLIT_RIGHT_BOTTOM; import static com.android.launcher3.testing.shared.TestProtocol.LAUNCH_SPLIT_PAIR; import static com.android.launcher3.testing.shared.TestProtocol.testLogD; Loading Loading @@ -531,10 +532,6 @@ public class SplitSelectStateController { mSplitFromDesktopController = new SplitFromDesktopController(launcher); } public void enterSplitFromDesktop(ActivityManager.RunningTaskInfo taskInfo) { mSplitFromDesktopController.enterSplitSelect(taskInfo); } private RemoteTransition getShellRemoteTransition(int firstTaskId, int secondTaskId, @Nullable Consumer<Boolean> callback, String transitionName) { final RemoteSplitLaunchTransitionRunner animationRunner = Loading Loading @@ -772,9 +769,11 @@ public class SplitSelectStateController { R.dimen.split_placeholder_inset); mSplitSelectListener = new ISplitSelectListener.Stub() { @Override public boolean onRequestSplitSelect(ActivityManager.RunningTaskInfo taskInfo) { public boolean onRequestSplitSelect(ActivityManager.RunningTaskInfo taskInfo, int splitPosition, Rect taskBounds) { if (!ENABLE_SPLIT_FROM_DESKTOP_TO_WORKSPACE.get()) return false; MAIN_EXECUTOR.execute(() -> enterSplitSelect(taskInfo)); MAIN_EXECUTOR.execute(() -> enterSplitSelect(taskInfo, splitPosition, taskBounds)); return true; } }; Loading @@ -784,8 +783,11 @@ public class SplitSelectStateController { /** * Enter split select from desktop mode. * @param taskInfo the desktop task to move to split stage * @param splitPosition the stage position used for this transition * @param taskBounds the bounds of the task, used for {@link FloatingTaskView} animation */ public void enterSplitSelect(ActivityManager.RunningTaskInfo taskInfo) { public void enterSplitSelect(ActivityManager.RunningTaskInfo taskInfo, int splitPosition, Rect taskBounds) { mTaskInfo = taskInfo; String packageName = mTaskInfo.realActivity.getPackageName(); PackageManager pm = mLauncher.getApplicationContext().getPackageManager(); Loading @@ -801,7 +803,7 @@ public class SplitSelectStateController { false /* allowMinimizeSplitScreen */); DesktopSplitRecentsAnimationListener listener = new DesktopSplitRecentsAnimationListener(); new DesktopSplitRecentsAnimationListener(splitPosition, taskBounds); MAIN_EXECUTOR.execute(() -> { callbacks.addListener(listener); Loading @@ -817,12 +819,23 @@ public class SplitSelectStateController { private class DesktopSplitRecentsAnimationListener implements RecentsAnimationCallbacks.RecentsAnimationListener { private final Rect mTempRect = new Rect(); private final RectF mTaskBounds = new RectF(); private final int mSplitPosition; DesktopSplitRecentsAnimationListener(int splitPosition, Rect taskBounds) { mSplitPosition = splitPosition; mTaskBounds.set(taskBounds); } @Override public void onRecentsAnimationStart(RecentsAnimationController controller, RecentsAnimationTargets targets) { setInitialTaskSelect(mTaskInfo, STAGE_POSITION_BOTTOM_OR_RIGHT, null, LAUNCHER_DESKTOP_MODE_SPLIT_RIGHT_BOTTOM); StatsLogManager.LauncherEvent launcherDesktopSplitEvent = mSplitPosition == STAGE_POSITION_BOTTOM_OR_RIGHT ? LAUNCHER_DESKTOP_MODE_SPLIT_RIGHT_BOTTOM : LAUNCHER_DESKTOP_MODE_SPLIT_LEFT_TOP; setInitialTaskSelect(mTaskInfo, mSplitPosition, null, launcherDesktopSplitEvent); RecentsView recentsView = mLauncher.getOverviewPanel(); recentsView.getPagedOrientationHandler().getInitialSplitPlaceholderBounds( Loading @@ -831,14 +844,12 @@ public class SplitSelectStateController { PendingAnimation anim = new PendingAnimation( SplitAnimationTimings.TABLET_HOME_TO_SPLIT.getDuration()); RectF startingTaskRect = new RectF(mTaskInfo.configuration.windowConfiguration .getBounds()); final FloatingTaskView floatingTaskView = FloatingTaskView.getFloatingTaskView( mLauncher, mLauncher.getDragLayer(), null /* thumbnail */, mAppIcon, new RectF()); floatingTaskView.setAlpha(1); floatingTaskView.addStagingAnimation(anim, startingTaskRect, mTempRect, floatingTaskView.addStagingAnimation(anim, mTaskBounds, mTempRect, false /* fadeWithThumbnail */, true /* isStagedTask */); setFirstFloatingTaskView(floatingTaskView); Loading src/com/android/launcher3/logging/StatsLogManager.java +4 −1 Original line number Diff line number Diff line Loading @@ -621,9 +621,12 @@ public class StatsLogManager implements ResourceBasedOverride { @UiEvent(doc = "User has invoked split to left half with a keyboard shortcut.") LAUNCHER_KEYBOARD_SHORTCUT_SPLIT_LEFT_TOP(1233), @UiEvent(doc = "User has invoked split to right half with desktop mode app icon") @UiEvent(doc = "User has invoked split to right half from desktop mode.") LAUNCHER_DESKTOP_MODE_SPLIT_RIGHT_BOTTOM(1412), @UiEvent(doc = "User has invoked split to left half from desktop mode.") LAUNCHER_DESKTOP_MODE_SPLIT_LEFT_TOP(1464), @UiEvent(doc = "User has collapsed the work FAB button by scrolling down in the all apps" + " work A-Z list.") LAUNCHER_WORK_FAB_BUTTON_COLLAPSE(1276), Loading Loading
quickstep/src/com/android/quickstep/util/SplitSelectStateController.java +24 −13 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.quickstep.util; import static com.android.launcher3.Utilities.postAsyncCallback; import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_DESKTOP_TO_WORKSPACE; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_DESKTOP_MODE_SPLIT_LEFT_TOP; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_DESKTOP_MODE_SPLIT_RIGHT_BOTTOM; import static com.android.launcher3.testing.shared.TestProtocol.LAUNCH_SPLIT_PAIR; import static com.android.launcher3.testing.shared.TestProtocol.testLogD; Loading Loading @@ -531,10 +532,6 @@ public class SplitSelectStateController { mSplitFromDesktopController = new SplitFromDesktopController(launcher); } public void enterSplitFromDesktop(ActivityManager.RunningTaskInfo taskInfo) { mSplitFromDesktopController.enterSplitSelect(taskInfo); } private RemoteTransition getShellRemoteTransition(int firstTaskId, int secondTaskId, @Nullable Consumer<Boolean> callback, String transitionName) { final RemoteSplitLaunchTransitionRunner animationRunner = Loading Loading @@ -772,9 +769,11 @@ public class SplitSelectStateController { R.dimen.split_placeholder_inset); mSplitSelectListener = new ISplitSelectListener.Stub() { @Override public boolean onRequestSplitSelect(ActivityManager.RunningTaskInfo taskInfo) { public boolean onRequestSplitSelect(ActivityManager.RunningTaskInfo taskInfo, int splitPosition, Rect taskBounds) { if (!ENABLE_SPLIT_FROM_DESKTOP_TO_WORKSPACE.get()) return false; MAIN_EXECUTOR.execute(() -> enterSplitSelect(taskInfo)); MAIN_EXECUTOR.execute(() -> enterSplitSelect(taskInfo, splitPosition, taskBounds)); return true; } }; Loading @@ -784,8 +783,11 @@ public class SplitSelectStateController { /** * Enter split select from desktop mode. * @param taskInfo the desktop task to move to split stage * @param splitPosition the stage position used for this transition * @param taskBounds the bounds of the task, used for {@link FloatingTaskView} animation */ public void enterSplitSelect(ActivityManager.RunningTaskInfo taskInfo) { public void enterSplitSelect(ActivityManager.RunningTaskInfo taskInfo, int splitPosition, Rect taskBounds) { mTaskInfo = taskInfo; String packageName = mTaskInfo.realActivity.getPackageName(); PackageManager pm = mLauncher.getApplicationContext().getPackageManager(); Loading @@ -801,7 +803,7 @@ public class SplitSelectStateController { false /* allowMinimizeSplitScreen */); DesktopSplitRecentsAnimationListener listener = new DesktopSplitRecentsAnimationListener(); new DesktopSplitRecentsAnimationListener(splitPosition, taskBounds); MAIN_EXECUTOR.execute(() -> { callbacks.addListener(listener); Loading @@ -817,12 +819,23 @@ public class SplitSelectStateController { private class DesktopSplitRecentsAnimationListener implements RecentsAnimationCallbacks.RecentsAnimationListener { private final Rect mTempRect = new Rect(); private final RectF mTaskBounds = new RectF(); private final int mSplitPosition; DesktopSplitRecentsAnimationListener(int splitPosition, Rect taskBounds) { mSplitPosition = splitPosition; mTaskBounds.set(taskBounds); } @Override public void onRecentsAnimationStart(RecentsAnimationController controller, RecentsAnimationTargets targets) { setInitialTaskSelect(mTaskInfo, STAGE_POSITION_BOTTOM_OR_RIGHT, null, LAUNCHER_DESKTOP_MODE_SPLIT_RIGHT_BOTTOM); StatsLogManager.LauncherEvent launcherDesktopSplitEvent = mSplitPosition == STAGE_POSITION_BOTTOM_OR_RIGHT ? LAUNCHER_DESKTOP_MODE_SPLIT_RIGHT_BOTTOM : LAUNCHER_DESKTOP_MODE_SPLIT_LEFT_TOP; setInitialTaskSelect(mTaskInfo, mSplitPosition, null, launcherDesktopSplitEvent); RecentsView recentsView = mLauncher.getOverviewPanel(); recentsView.getPagedOrientationHandler().getInitialSplitPlaceholderBounds( Loading @@ -831,14 +844,12 @@ public class SplitSelectStateController { PendingAnimation anim = new PendingAnimation( SplitAnimationTimings.TABLET_HOME_TO_SPLIT.getDuration()); RectF startingTaskRect = new RectF(mTaskInfo.configuration.windowConfiguration .getBounds()); final FloatingTaskView floatingTaskView = FloatingTaskView.getFloatingTaskView( mLauncher, mLauncher.getDragLayer(), null /* thumbnail */, mAppIcon, new RectF()); floatingTaskView.setAlpha(1); floatingTaskView.addStagingAnimation(anim, startingTaskRect, mTempRect, floatingTaskView.addStagingAnimation(anim, mTaskBounds, mTempRect, false /* fadeWithThumbnail */, true /* isStagedTask */); setFirstFloatingTaskView(floatingTaskView); Loading
src/com/android/launcher3/logging/StatsLogManager.java +4 −1 Original line number Diff line number Diff line Loading @@ -621,9 +621,12 @@ public class StatsLogManager implements ResourceBasedOverride { @UiEvent(doc = "User has invoked split to left half with a keyboard shortcut.") LAUNCHER_KEYBOARD_SHORTCUT_SPLIT_LEFT_TOP(1233), @UiEvent(doc = "User has invoked split to right half with desktop mode app icon") @UiEvent(doc = "User has invoked split to right half from desktop mode.") LAUNCHER_DESKTOP_MODE_SPLIT_RIGHT_BOTTOM(1412), @UiEvent(doc = "User has invoked split to left half from desktop mode.") LAUNCHER_DESKTOP_MODE_SPLIT_LEFT_TOP(1464), @UiEvent(doc = "User has collapsed the work FAB button by scrolling down in the all apps" + " work A-Z list.") LAUNCHER_WORK_FAB_BUTTON_COLLAPSE(1276), Loading