mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Merge "Freeze task list if requested when launching split tasks" into sc-v2-dev
This commit is contained in:
@@ -21,8 +21,10 @@ import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
|
||||
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
|
||||
|
||||
import android.app.ActivityOptions;
|
||||
import android.app.ActivityThread;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.view.RemoteAnimationAdapter;
|
||||
@@ -78,14 +80,15 @@ public class SplitSelectStateController {
|
||||
*/
|
||||
public void setSecondTaskId(Task taskView, Consumer<Boolean> callback) {
|
||||
mSecondTask = taskView;
|
||||
launchTasks(mInitialTask, mSecondTask, mStagePosition, callback);
|
||||
launchTasks(mInitialTask, mSecondTask, mStagePosition, callback,
|
||||
false /* freezeTaskList */);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param stagePosition representing location of task1
|
||||
*/
|
||||
public void launchTasks(Task task1, Task task2, @StagePosition int stagePosition,
|
||||
Consumer<Boolean> callback) {
|
||||
Consumer<Boolean> callback, boolean freezeTaskList) {
|
||||
// Assume initial task is for top/left part of screen
|
||||
final int[] taskIds = stagePosition == STAGE_POSITION_TOP_OR_LEFT
|
||||
? new int[]{task1.key.id, task2.key.id}
|
||||
@@ -105,8 +108,13 @@ public class SplitSelectStateController {
|
||||
300, 150,
|
||||
ActivityThread.currentActivityThread().getApplicationThread());
|
||||
|
||||
mSystemUiProxy.startTasksWithLegacyTransition(taskIds[0], null /* mainOptions */,
|
||||
taskIds[1], null /* sideOptions */, STAGE_POSITION_BOTTOM_OR_RIGHT, adapter);
|
||||
ActivityOptions mainOpts = ActivityOptions.makeBasic();
|
||||
if (freezeTaskList) {
|
||||
mainOpts.setFreezeRecentTasksReordering();
|
||||
}
|
||||
mSystemUiProxy.startTasksWithLegacyTransition(taskIds[0], mainOpts.toBundle(),
|
||||
taskIds[1], null /* sideOptions */, STAGE_POSITION_BOTTOM_OR_RIGHT,
|
||||
adapter);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -156,14 +156,15 @@ public class GroupedTaskView extends TaskView {
|
||||
@Override
|
||||
public RunnableList launchTaskAnimated() {
|
||||
getRecentsView().getSplitPlaceholder().launchTasks(mTask, mSecondaryTask,
|
||||
STAGE_POSITION_TOP_OR_LEFT, null /*callback*/);
|
||||
STAGE_POSITION_TOP_OR_LEFT, null /*callback*/,
|
||||
false /* freezeTaskList */);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void launchTask(@NonNull Consumer<Boolean> callback, boolean freezeTaskList) {
|
||||
getRecentsView().getSplitPlaceholder().launchTasks(mTask, mSecondaryTask,
|
||||
STAGE_POSITION_TOP_OR_LEFT, callback);
|
||||
STAGE_POSITION_TOP_OR_LEFT, callback, freezeTaskList);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user