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
This commit is contained in:
Tony Wickham
2020-06-01 18:15:28 -05:00
parent 0e1cbf56aa
commit 1287feb616
2 changed files with 10 additions and 5 deletions
@@ -357,6 +357,7 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc
mBitmapShader.setLocalMatrix(mPreviewPositionHelper.mMatrix);
mPaint.setShader(mBitmapShader);
}
getTaskView().updateCurrentFullscreenParams(mPreviewPositionHelper);
invalidate();
// Update can be called from {@link #onSizeChanged} during layout, post handling of overlay
@@ -951,11 +951,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
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 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
invalidateOutline();
}
void updateCurrentFullscreenParams(PreviewPositionHelper previewPositionHelper) {
mCurrentFullscreenParams.setProgress(
mFullscreenProgress,
getRecentsView().getScaleX(),
getWidth(), mActivity.getDeviceProfile(),
previewPositionHelper);
}
public boolean isRunningTask() {
if (getRecentsView() == null) {
return false;