Update TaskView fullscreen params when updating the thumbnail matrix
Previously, we were only updating the fullscreen params when updating
fullscreen progress. The problem with that is we optimize to skip
updating fullscreen progress if the new progress is the same as the
current. But since the fullscreen params depend on the insets computed
by the preview position helper, we should update the fullscreen params
when we update the preview position helper.
Test: force stop launcher, quick switch directly to the right, ensure
the adjacent TaskView has its insets applied properly
Bug: 157105795
Change-Id: I3c3b47c69205607c9e10ed38c403211816f30939
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskThumbnailView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskThumbnailView.java
index 78ac1cc..e224eab 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskThumbnailView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskThumbnailView.java
@@ -357,6 +357,7 @@
mBitmapShader.setLocalMatrix(mPreviewPositionHelper.mMatrix);
mPaint.setShader(mBitmapShader);
}
+ getTaskView().updateCurrentFullscreenParams(mPreviewPositionHelper);
invalidate();
// Update can be called from {@link #onSizeChanged} during layout, post handling of overlay
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java
index 6b759ba..5d80e6a 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java
@@ -951,11 +951,7 @@
setClipToPadding(!isFullscreen);
TaskThumbnailView thumbnail = getThumbnail();
- mCurrentFullscreenParams.setProgress(
- mFullscreenProgress,
- getRecentsView().getScaleX(),
- getWidth(), mActivity.getDeviceProfile(),
- thumbnail.getPreviewPositionHelper());
+ updateCurrentFullscreenParams(thumbnail.getPreviewPositionHelper());
if (!getRecentsView().isTaskIconScaledDown(this)) {
// Some of the items in here are dependent on the current fullscreen params, but don't
@@ -968,6 +964,14 @@
invalidateOutline();
}
+ void updateCurrentFullscreenParams(PreviewPositionHelper previewPositionHelper) {
+ mCurrentFullscreenParams.setProgress(
+ mFullscreenProgress,
+ getRecentsView().getScaleX(),
+ getWidth(), mActivity.getDeviceProfile(),
+ previewPositionHelper);
+ }
+
public boolean isRunningTask() {
if (getRecentsView() == null) {
return false;