mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 17:06:49 +00:00
Merge "Place TaskMenuView aligned with secondary split thumbnail" into tm-qpr-dev
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.android.quickstep.views;
|
||||
|
||||
import static com.android.launcher3.AbstractFloatingView.getAnyView;
|
||||
import static com.android.launcher3.util.SplitConfigurationOptions.DEFAULT_SPLIT_RATIO;
|
||||
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
|
||||
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
|
||||
@@ -13,6 +14,7 @@ import android.view.View;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.AbstractFloatingView;
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.Utilities;
|
||||
@@ -162,6 +164,21 @@ public class GroupedTaskView extends TaskView {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showTaskMenuWithContainer(IconView iconView) {
|
||||
boolean showedTaskMenu = super.showTaskMenuWithContainer(iconView);
|
||||
if (iconView == mIconView2 && showedTaskMenu && !isGridTask()) {
|
||||
// Adjust the position of the secondary task's menu view (only on phones)
|
||||
TaskMenuView taskMenuView = getAnyView(mActivity, AbstractFloatingView.TYPE_TASK_MENU);
|
||||
DeviceProfile deviceProfile = mActivity.getDeviceProfile();
|
||||
getRecentsView().getPagedOrientationHandler()
|
||||
.setSecondaryTaskMenuPosition(mSplitBoundsConfig, this,
|
||||
deviceProfile, mTaskIdAttributeContainer[0].getThumbnailView(),
|
||||
taskMenuView);
|
||||
}
|
||||
return showedTaskMenu;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public RunnableList launchTaskAnimated() {
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
package com.android.quickstep.views;
|
||||
|
||||
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
|
||||
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_UNDEFINED;
|
||||
import static com.android.quickstep.views.TaskThumbnailView.DIM_ALPHA;
|
||||
|
||||
import android.animation.Animator;
|
||||
@@ -156,23 +154,6 @@ public class TaskMenuView extends AbstractFloatingView implements OnScrollChange
|
||||
mTaskContainer.getThumbnailView(), overscrollShift, deviceProfile));
|
||||
setY(pagedOrientationHandler.getTaskMenuY(
|
||||
adjustedY, mTaskContainer.getThumbnailView(), overscrollShift));
|
||||
|
||||
// TODO(b/193432925) temporary menu placement for split screen task menus
|
||||
TaskIdAttributeContainer[] taskIdAttributeContainers =
|
||||
mTaskView.getTaskIdAttributeContainers();
|
||||
if (taskIdAttributeContainers[0].getStagePosition() != STAGE_POSITION_UNDEFINED) {
|
||||
if (mTaskContainer.getStagePosition() != STAGE_POSITION_BOTTOM_OR_RIGHT) {
|
||||
return;
|
||||
}
|
||||
Rect r = new Rect();
|
||||
mTaskContainer.getThumbnailView().getBoundsOnScreen(r);
|
||||
if (deviceProfile.isLandscape) {
|
||||
setX(r.left);
|
||||
} else {
|
||||
setY(r.top);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onRotationChanged() {
|
||||
|
||||
Reference in New Issue
Block a user