From 7b63f6f1304a63db1d14848940fc5bea4f83b1c0 Mon Sep 17 00:00:00 2001 From: Matt Casey Date: Mon, 12 Apr 2021 12:04:41 -0400 Subject: [PATCH] Hide CropView until the image is ready. Test: Verify crop view shows up at the right time with a fresh long screenshot or reloading saved state Bug: 185115974 Change-Id: I18705e6a8c4a762abf30e2db22bc54d9a5db12aa --- packages/SystemUI/res/layout/long_screenshot.xml | 1 + .../com/android/systemui/screenshot/LongScreenshotActivity.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/packages/SystemUI/res/layout/long_screenshot.xml b/packages/SystemUI/res/layout/long_screenshot.xml index e775de2d8e068..fb783a760c3d0 100644 --- a/packages/SystemUI/res/layout/long_screenshot.xml +++ b/packages/SystemUI/res/layout/long_screenshot.xml @@ -71,6 +71,7 @@ android:layout_height="0px" android:paddingTop="8dp" android:paddingBottom="42dp" + android:visibility="gone" app:layout_constrainedHeight="true" app:layout_constrainedWidth="true" app:layout_constraintTop_toTopOf="@id/preview" diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/LongScreenshotActivity.java b/packages/SystemUI/src/com/android/systemui/screenshot/LongScreenshotActivity.java index 9ce0eebfd4411..33041d280b9b5 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/LongScreenshotActivity.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/LongScreenshotActivity.java @@ -207,6 +207,7 @@ public class LongScreenshotActivity extends Activity { mLongScreenshot = longScreenshot; mPreview.setImageDrawable(mLongScreenshot.getDrawable()); updateImageDimensions(); + mCropView.setVisibility(View.VISIBLE); mMagnifierView.setDrawable(mLongScreenshot.getDrawable(), mLongScreenshot.getWidth(), mLongScreenshot.getHeight()); // Original boundaries go from the image tile set's y=0 to y=pageSize, so @@ -240,6 +241,7 @@ public class LongScreenshotActivity extends Activity { mPreview.setImageDrawable(drawable); mMagnifierView.setDrawable(drawable, imageResult.bitmap.getWidth(), imageResult.bitmap.getHeight()); + mCropView.setVisibility(View.VISIBLE); mSavedImagePath = imageResult.fileName; setButtonsEnabled(true);