Overview - don't update task overlay on thumbnail update.

Only init and reset the task overlay on the enabled state of the overlay
changing.
Previously the overlay was also updated when the thumbnail changed, but
this can happen for lots of different reasons so was causing janky
transitions and potentially excess work in code that was following the
overlay.

The overlay code really only cares about the thumbnail after the task has
settled, so should be safe to ignore the thumbnail updates.



Bug: 188097940
Test: local build and run on p5
Change-Id: I4ad1767046cb0316af19713bc188788d8f581d7c
This commit is contained in:
zakcohen
2021-05-12 13:55:34 -07:00
parent 549ea0b3a9
commit a6ca69aa53

View File

@@ -335,16 +335,13 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc
public void setOverlayEnabled(boolean overlayEnabled) {
if (mOverlayEnabled != overlayEnabled) {
mOverlayEnabled = overlayEnabled;
updateOverlay();
}
}
private void updateOverlay() {
if (mOverlayEnabled) {
getTaskOverlay().initOverlay(mTask, mThumbnailData, mPreviewPositionHelper.mMatrix,
mPreviewPositionHelper.mIsOrientationChanged);
} else {
getTaskOverlay().reset();
if (mOverlayEnabled) {
getTaskOverlay().initOverlay(mTask, mThumbnailData, mPreviewPositionHelper.mMatrix,
mPreviewPositionHelper.mIsOrientationChanged);
} else {
getTaskOverlay().reset();
}
}
}
@@ -379,10 +376,6 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc
}
getTaskView().updateCurrentFullscreenParams(mPreviewPositionHelper);
invalidate();
// Update can be called from {@link #onSizeChanged} during layout, post handling of overlay
// as overlay could modify the views in the overlay as a side effect of its update.
post(this::updateOverlay);
}
@Override