mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 19:38:21 +00:00
Merge "Fix bug with selecting a secondary task as second splitscreen app via Taskbar" into tm-qpr-dev am: 5be7cde8fa
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21168146 Change-Id: I2254294f59428f7b8e46f143f9d9778af7accd33 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -31,6 +31,7 @@ import com.android.launcher3.util.DisplayController;
|
||||
import com.android.launcher3.util.SplitConfigurationOptions;
|
||||
import com.android.quickstep.views.RecentsView;
|
||||
import com.android.quickstep.views.TaskView;
|
||||
import com.android.quickstep.views.TaskView.TaskIdAttributeContainer;
|
||||
import com.android.systemui.shared.recents.model.Task;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
@@ -202,12 +203,16 @@ public class TaskbarUIController {
|
||||
// null checks as much. See comments at ag/21152798.
|
||||
if (foundTaskView != null) {
|
||||
// There is already a running app of this type, use that as second app.
|
||||
// Get index of task (0 or 1), in case it's a GroupedTaskView
|
||||
int indexOfTask = foundTaskView.getIndexOfTask(foundTask.key.id);
|
||||
TaskIdAttributeContainer taskAttributes =
|
||||
foundTaskView.getTaskIdAttributeContainers()[indexOfTask];
|
||||
recents.confirmSplitSelect(
|
||||
foundTaskView,
|
||||
foundTaskView.getTask(),
|
||||
foundTaskView.getIconView().getDrawable(),
|
||||
foundTaskView.getThumbnail(),
|
||||
foundTaskView.getThumbnail().getThumbnail(),
|
||||
taskAttributes.getTask(),
|
||||
taskAttributes.getIconView().getDrawable(),
|
||||
taskAttributes.getThumbnailView(),
|
||||
taskAttributes.getThumbnailView().getThumbnail(),
|
||||
null /* intent */);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -600,6 +600,19 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
return mTaskIdContainer[1] != -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the index of a given taskId within this TaskView, or -1 if the TaskView does not
|
||||
* contain it. For grouped tasks (of two), this is 0 or 1; for solo tasks, it is 0.
|
||||
*/
|
||||
public int getIndexOfTask(int taskId) {
|
||||
for (int i = 0; i < mTaskIdContainer.length; i++) {
|
||||
if (mTaskIdContainer[i] == taskId) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public TaskThumbnailView getThumbnail() {
|
||||
return mSnapshotView;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user