Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6ca69aa authored by zakcohen's avatar zakcohen
Browse files

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
parent 549ea0b3
Loading
Loading
Loading
Loading
+6 −13
Original line number Diff line number Diff line
@@ -335,11 +335,7 @@ 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);
@@ -347,6 +343,7 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc
                getTaskOverlay().reset();
            }
        }
    }

    private void updateThumbnailPaintFilter() {
        ColorFilter filter = getColorFilter(mDimAlpha);
@@ -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