mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 01:46:49 +00:00
Fix bug with selecting a secondary task as second splitscreen app via Taskbar
This patch makes it so that the correct task will be chosen when selecting a second splitscreen app via Taskbar. Prior to this patch, the Taskbar app selection function -- which attempts to match the tapped icon to a running TaskView -- assumed that the TaskView in question was always a solo (non-grouped) Task. This resulted in the wrong app being selected for split when the desired Task happened to be the secondary app in a pair. Fixed by checking to see if the desired app is primary or secondary, and returning the correct Task, IconView, and ThumbnailView for the split operation. Fixes: 265244769 Test: Manual Change-Id: Ie1122d1b49151d70dec9711fe558fba7752b7d8e
This commit is contained in:
@@ -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