mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 18:06:48 +00:00
Merge "Scale screenWidth for split proportionally for thumbnail matrix" into tm-qpr-dev
This commit is contained in:
@@ -191,6 +191,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
|
||||
mStagePosition = mThumbnailPosition.equals(splitInfo.leftTopBounds) ?
|
||||
STAGE_POSITION_TOP_OR_LEFT :
|
||||
STAGE_POSITION_BOTTOM_OR_RIGHT;
|
||||
mPositionHelper.setSplitBounds(convertSplitBounds(mSplitBounds), mStagePosition);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -418,4 +419,15 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
|
||||
return Math.max(Math.abs(mTempPoint[0]), Math.abs(mTempPoint[1]));
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO(b/254378592): Remove this after consolidation of classes
|
||||
*/
|
||||
public static com.android.wm.shell.util.SplitBounds convertSplitBounds(SplitBounds bounds) {
|
||||
return new com.android.wm.shell.util.SplitBounds(
|
||||
bounds.leftTopBounds,
|
||||
bounds.rightBottomBounds,
|
||||
bounds.leftTopTaskId,
|
||||
bounds.rightBottomTaskId
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.util.RunnableList;
|
||||
import com.android.launcher3.util.SplitConfigurationOptions;
|
||||
import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds;
|
||||
import com.android.launcher3.util.TransformingTouchDelegate;
|
||||
import com.android.quickstep.RecentsModel;
|
||||
@@ -26,8 +27,10 @@ import com.android.quickstep.TaskIconCache;
|
||||
import com.android.quickstep.TaskThumbnailCache;
|
||||
import com.android.quickstep.util.CancellableTask;
|
||||
import com.android.quickstep.util.RecentsOrientedState;
|
||||
import com.android.quickstep.util.TaskViewSimulator;
|
||||
import com.android.systemui.shared.recents.model.Task;
|
||||
import com.android.systemui.shared.recents.model.ThumbnailData;
|
||||
import com.android.systemui.shared.recents.utilities.PreviewPositionHelper;
|
||||
import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -86,9 +89,19 @@ public class GroupedTaskView extends TaskView {
|
||||
mTaskIdContainer[1] = secondary.key.id;
|
||||
mTaskIdAttributeContainer[1] = new TaskIdAttributeContainer(secondary, mSnapshotView2,
|
||||
mIconView2, STAGE_POSITION_BOTTOM_OR_RIGHT);
|
||||
mTaskIdAttributeContainer[0].setStagePosition(STAGE_POSITION_TOP_OR_LEFT);
|
||||
mTaskIdAttributeContainer[0].setStagePosition(
|
||||
SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT);
|
||||
mSnapshotView2.bind(secondary);
|
||||
mSplitBoundsConfig = splitBoundsConfig;
|
||||
if (mSplitBoundsConfig == null) {
|
||||
return;
|
||||
}
|
||||
mSnapshotView.getPreviewPositionHelper().setSplitBounds(TaskViewSimulator
|
||||
.convertSplitBounds(splitBoundsConfig),
|
||||
PreviewPositionHelper.STAGE_POSITION_TOP_OR_LEFT);
|
||||
mSnapshotView2.getPreviewPositionHelper().setSplitBounds(TaskViewSimulator
|
||||
.convertSplitBounds(splitBoundsConfig),
|
||||
PreviewPositionHelper.STAGE_POSITION_BOTTOM_OR_RIGHT);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -207,7 +220,8 @@ public class GroupedTaskView extends TaskView {
|
||||
@Override
|
||||
public void launchTask(@NonNull Consumer<Boolean> callback, boolean freezeTaskList) {
|
||||
getRecentsView().getSplitSelectController().launchTasks(mTask.key.id, mSecondaryTask.key.id,
|
||||
STAGE_POSITION_TOP_OR_LEFT, callback, freezeTaskList, getSplitRatio());
|
||||
SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT, callback, freezeTaskList,
|
||||
getSplitRatio());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -100,6 +100,7 @@ public final class SplitConfigurationOptions {
|
||||
* with the same name/functionality in wm.shell.util (which launcher3 cannot be built against)
|
||||
*
|
||||
* If you make changes here, consider making the same changes there
|
||||
* TODO(b/254378592): We really need to consolidate this
|
||||
*/
|
||||
public static class SplitBounds {
|
||||
public final Rect leftTopBounds;
|
||||
|
||||
Reference in New Issue
Block a user