From fcbf4c98003f7f49b83aea0772e81fa89ca5dd31 Mon Sep 17 00:00:00 2001 From: Miranda Kephart Date: Thu, 17 Jun 2021 15:27:37 -0400 Subject: [PATCH] Make screenshot animation display over cutout area The screenshot preview is inset to avoid showing on top of the cutout. However, the animation should display on top of the cutout, since the screenshot is of the whole screen and includes the cutout. This change shifts the start position of the animation by the amount of the insets. Bug: 191384262 Fix: 191384262 Test: manual Change-Id: I2cfa0a7d9fec49b3c00f28f6127527b899cf131b --- .../src/com/android/systemui/screenshot/ScreenshotView.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java index 2a2217912b584..0631739cf7604 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java @@ -479,6 +479,11 @@ public class ScreenshotView extends FrameLayout implements final PointF finalPos = new PointF(targetPosition.exactCenterX(), targetPosition.exactCenterY()); + // Shift to screen coordinates so that the animation runs on top of the entire screen, + // including e.g. bars covering the display cutout. + int[] locInScreen = mScreenshotPreview.getLocationOnScreen(); + startPos.offset(targetPosition.left - locInScreen[0], targetPosition.top - locInScreen[1]); + if (DEBUG_ANIM) { Log.d(TAG, "toCorner: startPos=" + startPos); Log.d(TAG, "toCorner: finalPos=" + finalPos);