Merge "desktop-exploded-view: Fix broken live tile when activating desk" into main

This commit is contained in:
Daniel Andersson
2025-05-05 12:46:01 -07:00
committed by Android (Google) Code Review
2 changed files with 12 additions and 25 deletions
@@ -229,8 +229,8 @@ public final class TaskViewUtils {
boolean showAsGrid = dp.isTablet;
boolean parallaxCenterAndAdjacentTask =
!showAsGrid && taskIndex != recentsView.getCurrentPage();
int taskRectTranslationPrimary = recentsView.getScrollOffset(taskIndex);
int taskRectTranslationSecondary = showAsGrid ? (int) taskView.getGridTranslationY() : 0;
int scrollOffset = recentsView.getScrollOffset(taskIndex);
int gridTranslationY = showAsGrid ? (int) taskView.getGridTranslationY() : 0;
RemoteTargetHandle[] topMostSimulators = null;
@@ -244,15 +244,15 @@ public final class TaskViewUtils {
// be stale. Use the display value instead.
int displayRotation = DisplayController.INSTANCE.get(context).getInfo().rotation;
tvsLocal.getOrientationState().update(displayRotation, displayRotation);
tvsLocal.calculateTaskSize();
tvsLocal.fullScreenProgress.value = 0;
tvsLocal.recentsViewScale.value = 1;
if (!enableGridOnlyOverview()) {
tvsLocal.setIsGridTask(taskView.isGridTask());
}
tvsLocal.getOrientationState().getOrientationHandler().set(tvsLocal,
TaskViewSimulator::setTaskRectTranslation, taskRectTranslationPrimary,
taskRectTranslationSecondary);
tvsLocal.recentsViewScroll.value = scrollOffset;
tvsLocal.taskSecondaryTranslation.value = gridTranslationY;
if (taskView instanceof DesktopTaskView) {
targetHandle.getTransformParams().setTargetAlpha(1f);
@@ -120,9 +120,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
private boolean mIsGridTask;
private final boolean mIsDesktopTask;
private boolean mIsAnimatingToCarousel = false;
private int mTaskRectTranslationX;
private int mTaskRectTranslationY;
private int mDesktopTaskIndex = 0;
private final int mDesktopTaskIndex;
@Nullable
private Matrix mTaskRectTransform = null;
@@ -159,7 +157,10 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
calculateTaskSize();
}
private void calculateTaskSize() {
/**
* Updates the task size.
*/
public void calculateTaskSize() {
if (mDp == null) {
return;
}
@@ -211,7 +212,6 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
} else {
mTaskRect.set(mFullTaskSize);
}
mTaskRect.offset(mTaskRectTranslationX, mTaskRectTranslationY);
}
/**
@@ -229,11 +229,8 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
if (mDp == null) {
return 1;
}
// Copy mFullTaskSize instead of updating it directly so it could be reused next time
// without recalculating
Rect scaleRect = new Rect(mIsAnimatingToCarousel ? mCarouselTaskSize : mFullTaskSize);
scaleRect.offset(mTaskRectTranslationX, mTaskRectTranslationY);
float scale = mOrientationState.getFullScreenScaleAndPivot(scaleRect, mDp, mPivot);
float scale = mOrientationState.getFullScreenScaleAndPivot(
mIsAnimatingToCarousel ? mCarouselTaskSize : mFullTaskSize, mDp, mPivot);
if (mPivotOverride != null) {
mPivot.set(mPivotOverride);
}
@@ -314,16 +311,6 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
mDrawAboveOtherApps = drawsAboveOtherApps;
}
/**
* Apply translations on TaskRect's starting location.
*/
public void setTaskRectTranslation(int taskRectTranslationX, int taskRectTranslationY) {
mTaskRectTranslationX = taskRectTranslationX;
mTaskRectTranslationY = taskRectTranslationY;
// Re-calculate task size after changing translation
calculateTaskSize();
}
/**
* Override the pivot used to apply scale changes.
*/