Merge "Update colors for popup menus" into udc-dev

This commit is contained in:
Federico Baron
2023-05-18 21:03:19 +00:00
committed by Android (Google) Code Review
14 changed files with 78 additions and 9 deletions
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2023 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:color="@android:color/system_neutral1_900"
android:lStar="12" />
</selector>
+20
View File
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2023 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:color="@android:color/system_neutral1_50"
android:lStar="94" />
</selector>
+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2023 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:color="?attr/popupColorBackground" />
</selector>
+1 -1
View File
@@ -15,6 +15,6 @@
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="?attr/popupColorPrimary"/>
<solid android:color="?attr/popupColorBackground"/>
<corners android:radius="@dimen/dialogCornerRadius"/>
</shape>
+1 -1
View File
@@ -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" />
+2 -2
View File
@@ -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"/>
</merge>
+1 -1
View File
@@ -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" />
+1 -1
View File
@@ -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"
@@ -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"
+2
View File
@@ -20,10 +20,12 @@
<color name="popup_color_primary_light">@android:color/system_accent2_50</color>
<color name="popup_color_secondary_light">@android:color/system_neutral2_100</color>
<color name="popup_color_tertiary_light">@android:color/system_neutral2_300</color>
<color name="popup_text_color_light">@android:color/system_neutral1_900</color>
<color name="popup_color_neutral_dark">@android:color/system_neutral1_1000</color>
<color name="popup_color_primary_dark">@android:color/system_neutral2_800</color>
<color name="popup_color_secondary_dark">@android:color/system_neutral1_900</color>
<color name="popup_color_tertiary_dark">@android:color/system_neutral2_700</color>
<color name="popup_text_color_dark">@android:color/system_neutral1_100</color>
<color name="popup_notification_dot_light">@android:color/system_accent1_100</color>
<color name="popup_notification_dot_dark">@android:color/system_accent2_600</color>
+2
View File
@@ -25,6 +25,8 @@
<attr name="popupColorPrimary" format="color" />
<attr name="popupColorSecondary" format="color" />
<attr name="popupColorTertiary" format="color" />
<attr name="popupColorBackground" format="color" />
<attr name="popupTextColor" format="color" />
<attr name="popupShadeFirst" format="color" />
<attr name="popupShadeSecond" format="color" />
<attr name="popupShadeThird" format="color" />
+2
View File
@@ -39,10 +39,12 @@
<color name="popup_color_primary_light">#FFF</color>
<color name="popup_color_secondary_light">#F1F3F4</color>
<color name="popup_color_tertiary_light">#E0E0E0</color> <!-- Gray 300 -->
<color name="popup_text_color_light">#1F1F1F</color>
<color name="popup_color_neutral_dark">#3C4043</color> <!-- Gray 800 -->
<color name="popup_color_primary_dark">#3C4043</color> <!-- Gray 800 -->
<color name="popup_color_secondary_dark">#202124</color>
<color name="popup_color_tertiary_dark">#757575</color> <!-- Gray 600 -->
<color name="popup_text_color_dark">#E3E3E3</color>
<color name="popup_shade_first_light">#F9F9F9</color>
<color name="popup_shade_second_light">#F1F1F1</color>
+4
View File
@@ -37,6 +37,8 @@
<item name="popupColorPrimary">@color/popup_color_primary_light</item>
<item name="popupColorSecondary">@color/popup_color_secondary_light</item>
<item name="popupColorTertiary">@color/popup_color_tertiary_light</item>
<item name="popupColorBackground">#EFEDED</item>
<item name="popupTextColor">@color/popup_text_color_light</item>
<item name="popupShadeFirst">@color/popup_shade_first_light</item>
<item name="popupShadeSecond">@color/popup_shade_second_light</item>
<item name="popupShadeThird">@color/popup_shade_third_light</item>
@@ -105,6 +107,8 @@
<item name="popupColorPrimary">@color/popup_color_primary_dark</item>
<item name="popupColorSecondary">@color/popup_color_secondary_dark</item>
<item name="popupColorTertiary">@color/popup_color_tertiary_dark</item>
<item name="popupColorBackground">#1F2020</item>
<item name="popupTextColor">@color/popup_text_color_dark</item>
<item name="popupNotificationDotColor">@color/popup_notification_dot_dark</item>
<item name="popupShadeFirst">@color/popup_shade_first_dark</item>
<item name="popupShadeSecond">@color/popup_shade_second_dark</item>
@@ -144,7 +144,8 @@ public abstract class ArrowPopup<T extends Context & ActivityContext>
// 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<T extends Context & ActivityContext>
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};
}
}