From e73f295f8e78c712cbd78fc8620c44351b6f5313 Mon Sep 17 00:00:00 2001 From: Miranda Kephart Date: Mon, 2 May 2022 09:21:44 -0400 Subject: [PATCH] Use drop shadow for screenshots instead of scrim Aligns with clipboard UI; also makes screenshot UI more lightweight. Bug: 231122823 Fix: 231122823 Test: manual (UI change only) Change-Id: I344ebf5d1f8e8862bcbb8976b309d6cf7f3c19af --- .../SystemUI/res/layout/clipboard_overlay.xml | 2 +- packages/SystemUI/res/layout/screenshot.xml | 9 +-------- .../SystemUI/res/layout/screenshot_static.xml | 15 ++++++++------- packages/SystemUI/res/values/dimens.xml | 3 --- .../systemui/screenshot/ScreenshotView.java | 16 ---------------- 5 files changed, 10 insertions(+), 35 deletions(-) diff --git a/packages/SystemUI/res/layout/clipboard_overlay.xml b/packages/SystemUI/res/layout/clipboard_overlay.xml index b230438f66fd6..e972c0947c546 100644 --- a/packages/SystemUI/res/layout/clipboard_overlay.xml +++ b/packages/SystemUI/res/layout/clipboard_overlay.xml @@ -67,7 +67,7 @@ android:layout_width="0dp" android:layout_height="0dp" android:layout_marginStart="@dimen/overlay_offset_x" - android:layout_marginBottom="@dimen/overlay_offset_y" + android:layout_marginBottom="8dp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintBottom_toBottomOf="@id/actions_container_background" android:elevation="7dp" diff --git a/packages/SystemUI/res/layout/screenshot.xml b/packages/SystemUI/res/layout/screenshot.xml index 890dbe592fc7c..c29e11bff6247 100644 --- a/packages/SystemUI/res/layout/screenshot.xml +++ b/packages/SystemUI/res/layout/screenshot.xml @@ -28,19 +28,12 @@ android:visibility="gone" android:clickable="true" android:importantForAccessibility="no"/> - + android:elevation="7dp"/> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 4a8fd1b00dde5..6678a927408ae 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -282,15 +282,12 @@ 8dp 14sp - 8dp 16dp - 4dp 8dp 242dp 18dp 4dp 8dp - 7dp 48dp 8dp 4dp diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java index 6af6e36a75f7a..ccfcaa692e224 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java @@ -149,7 +149,6 @@ public class ScreenshotView extends FrameLayout implements private ImageView mActionsContainerBackground; private HorizontalScrollView mActionsContainer; private LinearLayout mActionsView; - private ImageView mBackgroundProtection; private FrameLayout mDismissButton; private OverlayActionChip mShareChip; private OverlayActionChip mEditChip; @@ -345,8 +344,6 @@ public class ScreenshotView extends FrameLayout implements R.id.actions_container_background)); mActionsContainer = requireNonNull(findViewById(R.id.actions_container)); mActionsView = requireNonNull(findViewById(R.id.screenshot_actions)); - mBackgroundProtection = requireNonNull( - findViewById(R.id.screenshot_actions_background)); mDismissButton = requireNonNull(findViewById(R.id.screenshot_dismiss_button)); mScrollablePreview = requireNonNull(findViewById(R.id.screenshot_scrollable_preview)); mScreenshotFlash = requireNonNull(findViewById(R.id.screenshot_flash)); @@ -394,14 +391,6 @@ public class ScreenshotView extends FrameLayout implements } mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_SWIPE_DISMISSED, 0, mPackageName); - animator.addListener(new AnimatorListenerAdapter() { - @Override - public void onAnimationStart(Animator animation) { - super.onAnimationStart(animation); - mBackgroundProtection.animate() - .alpha(0).setDuration(animation.getDuration()).start(); - } - }); } @Override @@ -704,7 +693,6 @@ public class ScreenshotView extends FrameLayout implements animator.addUpdateListener(animation -> { float t = animation.getAnimatedFraction(); - mBackgroundProtection.setAlpha(t); float containerAlpha = t < alphaFraction ? t / alphaFraction : 1; mActionsContainer.setAlpha(containerAlpha); mActionsContainerBackground.setAlpha(containerAlpha); @@ -910,7 +898,6 @@ public class ScreenshotView extends FrameLayout implements } mDismissButton.setVisibility(View.GONE); mActionsContainer.setVisibility(View.GONE); - mBackgroundProtection.setVisibility(View.GONE); // set these invisible, but not gone, so that the views are laid out correctly mActionsContainerBackground.setVisibility(View.INVISIBLE); mScreenshotPreviewBorder.setVisibility(View.INVISIBLE); @@ -932,7 +919,6 @@ public class ScreenshotView extends FrameLayout implements mDismissButton.setVisibility(View.VISIBLE); } mActionsContainer.setVisibility(View.VISIBLE); - mBackgroundProtection.setVisibility(View.VISIBLE); mActionsContainerBackground.setVisibility(View.VISIBLE); mScreenshotPreviewBorder.setVisibility(View.VISIBLE); mScreenshotPreview.setVisibility(View.VISIBLE); @@ -969,7 +955,6 @@ public class ScreenshotView extends FrameLayout implements mPendingSharedTransition = false; mActionsContainerBackground.setVisibility(View.GONE); mActionsContainer.setVisibility(View.GONE); - mBackgroundProtection.setAlpha(0f); mDismissButton.setVisibility(View.GONE); mScrollingScrim.setVisibility(View.GONE); mScrollablePreview.setVisibility(View.GONE); @@ -1016,7 +1001,6 @@ public class ScreenshotView extends FrameLayout implements mDismissButton.setAlpha(alpha); mActionsContainerBackground.setAlpha(alpha); mActionsContainer.setAlpha(alpha); - mBackgroundProtection.setAlpha(alpha); mScreenshotPreviewBorder.setAlpha(alpha); }); alphaAnim.setDuration(600);