From 67fd70cdf35b958646a41431bcdb4155686bf2df Mon Sep 17 00:00:00 2001 From: Miranda Kephart Date: Wed, 19 May 2021 20:29:32 +0000 Subject: [PATCH] Update screenshot UI to use new Material colors Also updates some of the padding/margins and makes the dismiss button 32dp wide (tappable size 48dp). https://screenshot.googleplex.com/6QrPRKuJX7ruAZA (light mode) https://screenshot.googleplex.com/6CwbfTCdUU8Jmrx (dark mode) Bug: 187967953 Fix: 187967953 Test: manual Change-Id: Ice0109633810b4de0aeaae9024fe4257bc2fd4c4 --- .../res/drawable/action_chip_background.xml | 6 +-- .../action_chip_container_background.xml | 10 ++-- .../res/drawable/screenshot_border.xml | 23 +++++++++ .../res/drawable/screenshot_cancel.xml | 15 +++--- .../screenshot_preview_background.xml | 21 ++++++++ .../SystemUI/res/layout/global_screenshot.xml | 1 + .../layout/global_screenshot_action_chip.xml | 4 +- .../res/layout/global_screenshot_preview.xml | 33 ------------- .../res/layout/global_screenshot_static.xml | 48 +++++++++++++++++-- packages/SystemUI/res/values-night/styles.xml | 4 ++ packages/SystemUI/res/values/colors.xml | 6 --- packages/SystemUI/res/values/dimens.xml | 14 +++--- packages/SystemUI/res/values/styles.xml | 2 + .../systemui/screenshot/ScreenshotView.java | 29 +++++------ 14 files changed, 137 insertions(+), 79 deletions(-) create mode 100644 packages/SystemUI/res/drawable/screenshot_border.xml create mode 100644 packages/SystemUI/res/drawable/screenshot_preview_background.xml delete mode 100644 packages/SystemUI/res/layout/global_screenshot_preview.xml diff --git a/packages/SystemUI/res/drawable/action_chip_background.xml b/packages/SystemUI/res/drawable/action_chip_background.xml index ac227a604e565..0e1453c42e80f 100644 --- a/packages/SystemUI/res/drawable/action_chip_background.xml +++ b/packages/SystemUI/res/drawable/action_chip_background.xml @@ -16,12 +16,12 @@ --> - - + - \ No newline at end of file + diff --git a/packages/SystemUI/res/drawable/action_chip_container_background.xml b/packages/SystemUI/res/drawable/action_chip_container_background.xml index 095213e38e92d..72767a12bcf50 100644 --- a/packages/SystemUI/res/drawable/action_chip_container_background.xml +++ b/packages/SystemUI/res/drawable/action_chip_container_background.xml @@ -14,8 +14,10 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - - + + - \ No newline at end of file + diff --git a/packages/SystemUI/res/drawable/screenshot_border.xml b/packages/SystemUI/res/drawable/screenshot_border.xml new file mode 100644 index 0000000000000..bb858dbc795ad --- /dev/null +++ b/packages/SystemUI/res/drawable/screenshot_border.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/packages/SystemUI/res/drawable/screenshot_cancel.xml b/packages/SystemUI/res/drawable/screenshot_cancel.xml index f0dfd21a830d0..65b43541cf3fa 100644 --- a/packages/SystemUI/res/drawable/screenshot_cancel.xml +++ b/packages/SystemUI/res/drawable/screenshot_cancel.xml @@ -15,14 +15,15 @@ ~ limitations under the License. --> + android:viewportWidth="32.0" + android:viewportHeight="32.0"> + android:fillColor="?androidprv:attr/colorAccentSecondary" + android:pathData="M16,16m-16,0a16,16 0,1 1,32 0a16,16 0,1 1,-32 0"/> - \ No newline at end of file + android:fillColor="?android:attr/textColorPrimary" + android:pathData="M23,10.41L21.59,9 16,14.59 10.41,9 9,10.41 14.59,16 9,21.59 10.41,23 16,17.41 21.59,23 23,21.59 17.41,16z"/> + diff --git a/packages/SystemUI/res/drawable/screenshot_preview_background.xml b/packages/SystemUI/res/drawable/screenshot_preview_background.xml new file mode 100644 index 0000000000000..5adfaa134c3cd --- /dev/null +++ b/packages/SystemUI/res/drawable/screenshot_preview_background.xml @@ -0,0 +1,21 @@ + + + + + diff --git a/packages/SystemUI/res/layout/global_screenshot.xml b/packages/SystemUI/res/layout/global_screenshot.xml index 3c58d16b95522..5bd181c824923 100644 --- a/packages/SystemUI/res/layout/global_screenshot.xml +++ b/packages/SystemUI/res/layout/global_screenshot.xml @@ -17,6 +17,7 @@ + android:textColor="?android:attr/textColorPrimary"/> diff --git a/packages/SystemUI/res/layout/global_screenshot_preview.xml b/packages/SystemUI/res/layout/global_screenshot_preview.xml deleted file mode 100644 index 100213bdfd8c2..0000000000000 --- a/packages/SystemUI/res/layout/global_screenshot_preview.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - \ No newline at end of file diff --git a/packages/SystemUI/res/layout/global_screenshot_static.xml b/packages/SystemUI/res/layout/global_screenshot_static.xml index 9f63c4334a8c6..60dbaf97b7f7b 100644 --- a/packages/SystemUI/res/layout/global_screenshot_static.xml +++ b/packages/SystemUI/res/layout/global_screenshot_static.xml @@ -37,7 +37,7 @@ android:layout_height="wrap_content" android:layout_marginEnd="@dimen/screenshot_action_container_margin_horizontal" android:layout_marginBottom="@dimen/screenshot_action_container_offset_y" - android:paddingHorizontal="@dimen/screenshot_action_container_padding_right" + android:paddingEnd="@dimen/screenshot_action_container_padding_right" android:paddingVertical="@dimen/screenshot_action_container_padding_vertical" android:elevation="1dp" android:scrollbars="none" @@ -45,7 +45,7 @@ app:layout_constraintWidth_percent="1.0" app:layout_constraintWidth_max="wrap" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@+id/global_screenshot_preview" + app:layout_constraintStart_toEndOf="@+id/global_screenshot_preview_border" app:layout_constraintEnd_toEndOf="parent"> - + + + + + ?android:attr/colorBackgroundFloating + + diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index 55596005bf12e..862d59e970a15 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -196,13 +196,7 @@ #ffffffff - #F5F5F5 - #000000 - @color/GM2_grey_300 #1f000000 - @color/GM2_blue_500 - #FFFFFF - @color/GM2_grey_500 #40000000 diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 19e4f9d6a13f1..d624793ee44b2 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -330,21 +330,21 @@ 400dp 80dp 242dp - 6dp - 32dp + 4dp + 24dp 16dp 48dp 8dp 16dp - 10dp - 6dp + 18dp + 4dp 8dp 8dp - 20dp + 8dp 8dp - 10dp - 7dp + 4dp + 11dp 18dp 8dp diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml index ecc60ecf5a69a..76cf7659d58f5 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -700,6 +700,8 @@ true +