mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Merge "Open Task into Desktop Mode when Taksbar is in DesktopMode" into main
This commit is contained in:
@@ -1287,9 +1287,25 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
||||
} else if (tag instanceof TaskItemInfo info) {
|
||||
RemoteTransition remoteTransition = canUnminimizeDesktopTask(info.getTaskId())
|
||||
? createUnminimizeRemoteTransition() : null;
|
||||
UI_HELPER_EXECUTOR.execute(() ->
|
||||
SystemUiProxy.INSTANCE.get(this).showDesktopApp(
|
||||
info.getTaskId(), remoteTransition));
|
||||
|
||||
if (areDesktopTasksVisible() && recents != null) {
|
||||
TaskView taskView = recents.getTaskViewByTaskId(info.getTaskId());
|
||||
if (taskView == null) return;
|
||||
RunnableList runnableList = taskView.launchWithAnimation();
|
||||
if (runnableList != null) {
|
||||
runnableList.add(() ->
|
||||
// wrapped it in runnable here since we need the post for DW to be
|
||||
// ready. if we don't other DW will be gone and only the launched task
|
||||
// will show.
|
||||
UI_HELPER_EXECUTOR.execute(() ->
|
||||
SystemUiProxy.INSTANCE.get(this).showDesktopApp(
|
||||
info.getTaskId(), remoteTransition)));
|
||||
}
|
||||
} else {
|
||||
UI_HELPER_EXECUTOR.execute(() ->
|
||||
SystemUiProxy.INSTANCE.get(this).showDesktopApp(
|
||||
info.getTaskId(), remoteTransition));
|
||||
}
|
||||
mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(
|
||||
/* stash= */ true);
|
||||
} else if (tag instanceof WorkspaceItemInfo) {
|
||||
@@ -1533,7 +1549,17 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
||||
.launchAppPair((AppPairIcon) launchingIconView,
|
||||
-1 /*cuj*/)));
|
||||
} else {
|
||||
startItemInfoActivity(itemInfos.get(0), foundTask);
|
||||
if (areDesktopTasksVisible()) {
|
||||
RunnableList runnableList = recents.launchDesktopTaskView();
|
||||
// Wrapping it in runnable so we post after DW is ready for the app
|
||||
// launch.
|
||||
if (runnableList != null) {
|
||||
runnableList.add(() -> UI_HELPER_EXECUTOR.execute(
|
||||
() -> startItemInfoActivity(itemInfos.get(0), foundTask)));
|
||||
}
|
||||
} else {
|
||||
startItemInfoActivity(itemInfos.get(0), foundTask);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -1509,6 +1509,19 @@ public abstract class RecentsView<
|
||||
return focusedTask != null && isTaskInExpectedScrollPosition(indexOfChild(focusedTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch DesktopTaskView if found.
|
||||
* @return provides runnable list to attach runnable at end of Desktop Mode launch
|
||||
*/
|
||||
public RunnableList launchDesktopTaskView() {
|
||||
for (TaskView taskView : getTaskViews()) {
|
||||
if (taskView instanceof DesktopTaskView) {
|
||||
return taskView.launchWithAnimation();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a {@link TaskView} that has taskId matching {@code taskId} or null if no match.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user