From 1a76d5c72deeb5253229a3b34875b3631fcd93ec Mon Sep 17 00:00:00 2001 From: fbaron Date: Wed, 10 May 2023 16:29:17 -0700 Subject: [PATCH] Update colors for popup menus Bug: 268521231 Test: Verify that popup menu colors match the figma attached in the bug Change-Id: I24025576a789775dfcf17694d16c0d5f6ee844fd --- .../popup_color_background.xml | 20 +++++++++++++++++++ res/color-v31/popup_color_background.xml | 20 +++++++++++++++++++ res/color/popup_color_background.xml | 18 +++++++++++++++++ res/drawable/popup_background_material_u.xml | 2 +- res/layout/deep_shortcut_material_u.xml | 2 +- res/layout/system_shortcut_content.xml | 4 ++-- res/layout/system_shortcut_icon_only.xml | 2 +- res/layout/system_shortcut_icon_only_end.xml | 2 +- .../system_shortcut_icon_only_start.xml | 2 +- res/values-v31/colors.xml | 2 ++ res/values/attrs.xml | 2 ++ res/values/colors.xml | 2 ++ res/values/styles.xml | 4 ++++ .../android/launcher3/popup/ArrowPopup.java | 5 +++-- 14 files changed, 78 insertions(+), 9 deletions(-) create mode 100644 res/color-night-v31/popup_color_background.xml create mode 100644 res/color-v31/popup_color_background.xml create mode 100644 res/color/popup_color_background.xml diff --git a/res/color-night-v31/popup_color_background.xml b/res/color-night-v31/popup_color_background.xml new file mode 100644 index 0000000000..13ceaa09e7 --- /dev/null +++ b/res/color-night-v31/popup_color_background.xml @@ -0,0 +1,20 @@ + + + + + diff --git a/res/color-v31/popup_color_background.xml b/res/color-v31/popup_color_background.xml new file mode 100644 index 0000000000..99155d8972 --- /dev/null +++ b/res/color-v31/popup_color_background.xml @@ -0,0 +1,20 @@ + + + + + diff --git a/res/color/popup_color_background.xml b/res/color/popup_color_background.xml new file mode 100644 index 0000000000..e87e77231c --- /dev/null +++ b/res/color/popup_color_background.xml @@ -0,0 +1,18 @@ + + + + + diff --git a/res/drawable/popup_background_material_u.xml b/res/drawable/popup_background_material_u.xml index 4d40ba8afd..6eedecb6ca 100644 --- a/res/drawable/popup_background_material_u.xml +++ b/res/drawable/popup_background_material_u.xml @@ -15,6 +15,6 @@ --> - + \ No newline at end of file diff --git a/res/layout/deep_shortcut_material_u.xml b/res/layout/deep_shortcut_material_u.xml index fc019e921f..2e21ddb842 100644 --- a/res/layout/deep_shortcut_material_u.xml +++ b/res/layout/deep_shortcut_material_u.xml @@ -35,7 +35,7 @@ android:singleLine="true" android:ellipsize="end" android:textSize="14sp" - android:textColor="?android:attr/textColorPrimary" + android:textColor="?attr/popupTextColor" launcher:layoutHorizontal="true" launcher:iconDisplay="shortcut_popup" launcher:iconSizeOverride="@dimen/deep_shortcut_icon_size" /> diff --git a/res/layout/system_shortcut_content.xml b/res/layout/system_shortcut_content.xml index 3008339653..396a110cd2 100644 --- a/res/layout/system_shortcut_content.xml +++ b/res/layout/system_shortcut_content.xml @@ -30,7 +30,7 @@ android:lines="1" android:ellipsize="end" android:hyphenationFrequency="full" - android:textColor="@color/system_shortcut_text" + android:textColor="?attr/popupTextColor" launcher:iconDisplay="shortcut_popup" launcher:layoutHorizontal="true" android:focusable="false" /> @@ -41,5 +41,5 @@ android:layout_height="@dimen/system_shortcut_icon_size" android:layout_marginStart="@dimen/system_shortcut_margin_start" android:layout_gravity="start|center_vertical" - android:backgroundTint="@color/system_shortcut_text"/> + android:backgroundTint="?attr/popupTextColor"/> diff --git a/res/layout/system_shortcut_icon_only.xml b/res/layout/system_shortcut_icon_only.xml index 92522aaaf2..748696ea97 100644 --- a/res/layout/system_shortcut_icon_only.xml +++ b/res/layout/system_shortcut_icon_only.xml @@ -18,7 +18,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="@dimen/system_shortcut_header_icon_touch_size" android:layout_height="@dimen/system_shortcut_header_icon_touch_size" - android:tint="?attr/iconOnlyShortcutColor" + android:tint="?attr/popupTextColor" android:tintMode="src_in" android:padding="@dimen/system_shortcut_header_icon_padding" android:theme="@style/PopupItemIconOnly" /> diff --git a/res/layout/system_shortcut_icon_only_end.xml b/res/layout/system_shortcut_icon_only_end.xml index b5b5f02c22..7059dd7b28 100644 --- a/res/layout/system_shortcut_icon_only_end.xml +++ b/res/layout/system_shortcut_icon_only_end.xml @@ -18,7 +18,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="@dimen/system_shortcut_header_icon_touch_size" android:layout_height="@dimen/system_shortcut_header_icon_touch_size" - android:tint="?attr/iconOnlyShortcutColor" + android:tint="?attr/popupTextColor" android:tintMode="src_in" android:padding="@dimen/system_shortcut_header_icon_padding" android:paddingStart="@dimen/system_shortcut_header_icon_padding_inner" diff --git a/res/layout/system_shortcut_icon_only_start.xml b/res/layout/system_shortcut_icon_only_start.xml index 33a6b17dcb..ad9f55a5d8 100644 --- a/res/layout/system_shortcut_icon_only_start.xml +++ b/res/layout/system_shortcut_icon_only_start.xml @@ -18,7 +18,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="@dimen/system_shortcut_header_icon_touch_size" android:layout_height="@dimen/system_shortcut_header_icon_touch_size" - android:tint="?attr/iconOnlyShortcutColor" + android:tint="?attr/popupTextColor" android:tintMode="src_in" android:padding="@dimen/system_shortcut_header_icon_padding" android:paddingStart="@dimen/system_shortcut_header_icon_padding_outer" diff --git a/res/values-v31/colors.xml b/res/values-v31/colors.xml index 0c036ff314..062eec3ccb 100644 --- a/res/values-v31/colors.xml +++ b/res/values-v31/colors.xml @@ -20,10 +20,12 @@ @android:color/system_accent2_50 @android:color/system_neutral2_100 @android:color/system_neutral2_300 + @android:color/system_neutral1_900 @android:color/system_neutral1_1000 @android:color/system_neutral2_800 @android:color/system_neutral1_900 @android:color/system_neutral2_700 + @android:color/system_neutral1_100 @android:color/system_accent1_100 @android:color/system_accent2_600 diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 418f5a73d1..ef30b496e1 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -25,6 +25,8 @@ + + diff --git a/res/values/colors.xml b/res/values/colors.xml index b1bff18c8a..d2380fdc32 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -39,10 +39,12 @@ #FFF #F1F3F4 #E0E0E0 + #1F1F1F #3C4043 #3C4043 #202124 #757575 + #E3E3E3 #F9F9F9 #F1F1F1 diff --git a/res/values/styles.xml b/res/values/styles.xml index 8f75550e10..45464d1971 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -37,6 +37,8 @@ @color/popup_color_primary_light @color/popup_color_secondary_light @color/popup_color_tertiary_light + #EFEDED + @color/popup_text_color_light @color/popup_shade_first_light @color/popup_shade_second_light @color/popup_shade_third_light @@ -105,6 +107,8 @@ @color/popup_color_primary_dark @color/popup_color_secondary_dark @color/popup_color_tertiary_dark + #1F2020 + @color/popup_text_color_dark @color/popup_notification_dot_dark @color/popup_shade_first_dark @color/popup_shade_second_dark diff --git a/src/com/android/launcher3/popup/ArrowPopup.java b/src/com/android/launcher3/popup/ArrowPopup.java index b59b37aebf..72f99cb4df 100644 --- a/src/com/android/launcher3/popup/ArrowPopup.java +++ b/src/com/android/launcher3/popup/ArrowPopup.java @@ -144,7 +144,8 @@ public abstract class ArrowPopup // Initialize arrow view final Resources resources = getResources(); - mArrowColor = getColorStateList(getContext(), R.color.popup_shade_first).getDefaultColor(); + mArrowColor = getColorStateList(getContext(), R.color.popup_color_background) + .getDefaultColor(); mChildContainerMargin = resources.getDimensionPixelSize(R.dimen.popup_margin); mArrowWidth = resources.getDimensionPixelSize(R.dimen.popup_arrow_width); mArrowHeight = resources.getDimensionPixelSize(R.dimen.popup_arrow_height); @@ -173,7 +174,7 @@ public abstract class ArrowPopup mColorIds = new int[]{R.color.popup_shade_first, R.color.popup_shade_second, R.color.popup_shade_third}; } else { - mColorIds = new int[]{R.color.popup_shade_first}; + mColorIds = new int[]{R.color.popup_color_background}; } }