From 8577c10535897d4723b85ad16994bcebf04b541d Mon Sep 17 00:00:00 2001 From: Marcelo Arteiro Date: Fri, 18 Oct 2024 11:51:49 +0000 Subject: [PATCH] Migrate materialColor* attributes into colors The new color were already introduces in a previous CL ag/30322786 This CL is about replacing the attribute usage by the new color resources, which should work the same but cannot be overwritten, or styled, guaranteeing consistency across the OS. The old attributes will be removed in CL: ag/29910036 Bug: 374273611 Test: presubmit Flag: EXEMPT Un-flaggable refactor of private color resources Change-Id: I05b5261054bcb6de40e4e40d633025495f3dd01f --- res/color/dream_card_color_state_list.xml | 4 +- .../dream_card_icon_color_state_list.xml | 4 +- .../dream_card_summary_color_state_list.xml | 4 +- .../dream_card_text_color_state_list.xml | 4 +- .../modes_icon_selectable_background.xml | 6 +-- res/color/modes_icon_selectable_icon.xml | 6 +-- ...cessibility_contrast_button_background.xml | 8 +-- res/drawable/broadcast_button_outline.xml | 2 +- .../color_contrast_preview_background.xml | 2 +- ...trast_preview_bottom_appbar_background.xml | 2 +- ...lor_contrast_preview_button_background.xml | 2 +- ...lor_contrast_preview_dialog_background.xml | 2 +- ..._contrast_preview_icon_edit_background.xml | 2 +- ...contrast_preview_icon_group_background.xml | 2 +- ...contrast_preview_icon_inbox_background.xml | 2 +- ..._contrast_preview_icon_star_background.xml | 2 +- .../color_contrast_preview_tag_background.xml | 2 +- res/drawable/dream_default_preview_icon.xml | 2 +- res/drawable/dream_preview_rounded_bg.xml | 2 +- res/drawable/ic_article_24dp.xml | 2 +- res/drawable/ic_article_filled_24dp.xml | 2 +- res/drawable/ic_chat_bubble_24dp.xml | 2 +- res/drawable/ic_edit_24dp.xml | 2 +- res/drawable/ic_group_24dp.xml | 2 +- res/drawable/ic_inbox_24dp.xml | 2 +- res/drawable/ic_modifier_keys_reset.xml | 2 +- res/drawable/ic_star_24dp.xml | 2 +- res/drawable/modifier_key_bordered.xml | 2 +- res/drawable/modifier_key_colored.xml | 2 +- .../modifier_key_lisetview_background.xml | 2 +- ...pointer_icon_fill_container_background.xml | 2 +- ...ce_circular_icons_plus_item_background.xml | 2 +- res/drawable/rounded_bg.xml | 2 +- .../sim_confirm_dialog_btn_outline.xml | 2 +- res/drawable/trackpad_bordered.xml | 2 +- res/drawable/trackpad_button_done_colored.xml | 2 +- res/drawable/user_select_background.xml | 4 +- ...olume_dialog_button_background_outline.xml | 2 +- .../accessibility_color_contrast_preview.xml | 14 +++--- .../accessibility_color_contrast_selector.xml | 6 +-- res/layout/homepage_preference.xml | 2 +- res/layout/homepage_preference_v2.xml | 2 +- res/layout/modifier_key_item.xml | 2 +- res/layout/modifier_key_picker_dialog.xml | 2 +- .../notification_ls_minimalism_selector.xml | 4 +- res/layout/pointer_icon_fill_style_layout.xml | 2 +- .../pointer_icon_stroke_style_layout.xml | 2 +- res/layout/preference_background.xml | 4 +- .../preference_circular_icons_plus_item.xml | 2 +- res/layout/preference_widget_arrow.xml | 2 +- res/layout/trackpad_gesture_preview.xml | 4 +- res/values-night/colors.xml | 2 +- res/values/colors.xml | 4 +- res/values/styles.xml | 4 +- res/values/themes.xml | 10 ++-- res/values/themes_expressive.xml | 10 ++-- src/com/android/settings/Utils.java | 3 +- .../profileselector/UserAdapter.java | 5 +- .../batteryusage/BatteryChartView.java | 5 +- .../ModifierKeysPickerDialogFragment.java | 3 +- .../ModifierKeysPreferenceController.java | 4 +- ...difierKeysRestorePreferenceController.java | 4 +- .../settings/notification/modes/IconUtil.java | 50 +++++++++++-------- 63 files changed, 125 insertions(+), 127 deletions(-) diff --git a/res/color/dream_card_color_state_list.xml b/res/color/dream_card_color_state_list.xml index 082408d1583..44ed589004f 100644 --- a/res/color/dream_card_color_state_list.xml +++ b/res/color/dream_card_color_state_list.xml @@ -17,6 +17,6 @@ - - + + \ No newline at end of file diff --git a/res/color/dream_card_icon_color_state_list.xml b/res/color/dream_card_icon_color_state_list.xml index ed34ae39357..f3e08721b92 100644 --- a/res/color/dream_card_icon_color_state_list.xml +++ b/res/color/dream_card_icon_color_state_list.xml @@ -17,6 +17,6 @@ - - + + \ No newline at end of file diff --git a/res/color/dream_card_summary_color_state_list.xml b/res/color/dream_card_summary_color_state_list.xml index a1845f44d95..7252abed0cb 100644 --- a/res/color/dream_card_summary_color_state_list.xml +++ b/res/color/dream_card_summary_color_state_list.xml @@ -17,6 +17,6 @@ - - + + \ No newline at end of file diff --git a/res/color/dream_card_text_color_state_list.xml b/res/color/dream_card_text_color_state_list.xml index b39bbed75c9..c4b3ef5f414 100644 --- a/res/color/dream_card_text_color_state_list.xml +++ b/res/color/dream_card_text_color_state_list.xml @@ -17,6 +17,6 @@ - - + + \ No newline at end of file diff --git a/res/color/modes_icon_selectable_background.xml b/res/color/modes_icon_selectable_background.xml index f9280c60d6c..b3b393562d3 100644 --- a/res/color/modes_icon_selectable_background.xml +++ b/res/color/modes_icon_selectable_background.xml @@ -19,7 +19,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"> - - - + + + diff --git a/res/color/modes_icon_selectable_icon.xml b/res/color/modes_icon_selectable_icon.xml index 8a517d5f474..a5ab92b1d5b 100644 --- a/res/color/modes_icon_selectable_icon.xml +++ b/res/color/modes_icon_selectable_icon.xml @@ -19,7 +19,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"> - - - + + + diff --git a/res/drawable/accessibility_contrast_button_background.xml b/res/drawable/accessibility_contrast_button_background.xml index 7e41aaebee4..5f0f5ad09ec 100644 --- a/res/drawable/accessibility_contrast_button_background.xml +++ b/res/drawable/accessibility_contrast_button_background.xml @@ -22,9 +22,9 @@ - + @@ -41,7 +41,7 @@ android:viewportHeight="24" android:tint="?attr/colorControlNormal"> @@ -55,7 +55,7 @@ android:left="@dimen/contrast_button_stroke_width" android:right="@dimen/contrast_button_stroke_width"> - + diff --git a/res/drawable/broadcast_button_outline.xml b/res/drawable/broadcast_button_outline.xml index c8658a9fccd..1645ad07a25 100644 --- a/res/drawable/broadcast_button_outline.xml +++ b/res/drawable/broadcast_button_outline.xml @@ -29,7 +29,7 @@ - - + \ No newline at end of file diff --git a/res/drawable/color_contrast_preview_bottom_appbar_background.xml b/res/drawable/color_contrast_preview_bottom_appbar_background.xml index f3392fb01b5..7ffe3742c56 100644 --- a/res/drawable/color_contrast_preview_bottom_appbar_background.xml +++ b/res/drawable/color_contrast_preview_bottom_appbar_background.xml @@ -17,7 +17,7 @@ - + - + diff --git a/res/drawable/color_contrast_preview_dialog_background.xml b/res/drawable/color_contrast_preview_dialog_background.xml index f60a271ec3d..61219ac36d7 100644 --- a/res/drawable/color_contrast_preview_dialog_background.xml +++ b/res/drawable/color_contrast_preview_dialog_background.xml @@ -17,6 +17,6 @@ - + \ No newline at end of file diff --git a/res/drawable/color_contrast_preview_icon_edit_background.xml b/res/drawable/color_contrast_preview_icon_edit_background.xml index 61fe4fef8f6..b6b2930f134 100644 --- a/res/drawable/color_contrast_preview_icon_edit_background.xml +++ b/res/drawable/color_contrast_preview_icon_edit_background.xml @@ -17,6 +17,6 @@ - + \ No newline at end of file diff --git a/res/drawable/color_contrast_preview_icon_group_background.xml b/res/drawable/color_contrast_preview_icon_group_background.xml index 46cd40d9acf..284d9caea88 100644 --- a/res/drawable/color_contrast_preview_icon_group_background.xml +++ b/res/drawable/color_contrast_preview_icon_group_background.xml @@ -17,6 +17,6 @@ - + \ No newline at end of file diff --git a/res/drawable/color_contrast_preview_icon_inbox_background.xml b/res/drawable/color_contrast_preview_icon_inbox_background.xml index 45d82852456..b63d9181cfa 100644 --- a/res/drawable/color_contrast_preview_icon_inbox_background.xml +++ b/res/drawable/color_contrast_preview_icon_inbox_background.xml @@ -17,7 +17,7 @@ - + \ No newline at end of file diff --git a/res/drawable/color_contrast_preview_icon_star_background.xml b/res/drawable/color_contrast_preview_icon_star_background.xml index 335ee886f7f..027d3e15904 100644 --- a/res/drawable/color_contrast_preview_icon_star_background.xml +++ b/res/drawable/color_contrast_preview_icon_star_background.xml @@ -17,6 +17,6 @@ - + \ No newline at end of file diff --git a/res/drawable/color_contrast_preview_tag_background.xml b/res/drawable/color_contrast_preview_tag_background.xml index a7b051aa280..91b090cd963 100644 --- a/res/drawable/color_contrast_preview_tag_background.xml +++ b/res/drawable/color_contrast_preview_tag_background.xml @@ -17,6 +17,6 @@ - + \ No newline at end of file diff --git a/res/drawable/dream_default_preview_icon.xml b/res/drawable/dream_default_preview_icon.xml index 8989929fdd7..be3f128a39d 100644 --- a/res/drawable/dream_default_preview_icon.xml +++ b/res/drawable/dream_default_preview_icon.xml @@ -20,6 +20,6 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - \ No newline at end of file diff --git a/res/drawable/dream_preview_rounded_bg.xml b/res/drawable/dream_preview_rounded_bg.xml index 7cae599b6c8..c7034e7fbef 100644 --- a/res/drawable/dream_preview_rounded_bg.xml +++ b/res/drawable/dream_preview_rounded_bg.xml @@ -17,6 +17,6 @@ - + \ No newline at end of file diff --git a/res/drawable/ic_article_24dp.xml b/res/drawable/ic_article_24dp.xml index 0b38daaf643..bf9d2f7f8c7 100644 --- a/res/drawable/ic_article_24dp.xml +++ b/res/drawable/ic_article_24dp.xml @@ -22,6 +22,6 @@ android:tint="?attr/colorControlNormal" android:autoMirrored="true"> diff --git a/res/drawable/ic_article_filled_24dp.xml b/res/drawable/ic_article_filled_24dp.xml index e22d151beb7..9e5f24c0aad 100644 --- a/res/drawable/ic_article_filled_24dp.xml +++ b/res/drawable/ic_article_filled_24dp.xml @@ -21,6 +21,6 @@ android:viewportHeight="24" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/ic_chat_bubble_24dp.xml b/res/drawable/ic_chat_bubble_24dp.xml index c7ad6bf28a1..5b6536b9655 100644 --- a/res/drawable/ic_chat_bubble_24dp.xml +++ b/res/drawable/ic_chat_bubble_24dp.xml @@ -21,6 +21,6 @@ android:viewportHeight="24" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/ic_edit_24dp.xml b/res/drawable/ic_edit_24dp.xml index e663b5275c0..fdd82f579d3 100644 --- a/res/drawable/ic_edit_24dp.xml +++ b/res/drawable/ic_edit_24dp.xml @@ -21,6 +21,6 @@ android:viewportHeight="24" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/ic_group_24dp.xml b/res/drawable/ic_group_24dp.xml index 92815c2cc2f..1c65fc26a4f 100644 --- a/res/drawable/ic_group_24dp.xml +++ b/res/drawable/ic_group_24dp.xml @@ -21,6 +21,6 @@ android:viewportHeight="24" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/ic_inbox_24dp.xml b/res/drawable/ic_inbox_24dp.xml index 7800ea145ef..18cc3e951ae 100644 --- a/res/drawable/ic_inbox_24dp.xml +++ b/res/drawable/ic_inbox_24dp.xml @@ -21,6 +21,6 @@ android:viewportHeight="24" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/ic_modifier_keys_reset.xml b/res/drawable/ic_modifier_keys_reset.xml index 5345c2578f9..9fdbab0b53a 100644 --- a/res/drawable/ic_modifier_keys_reset.xml +++ b/res/drawable/ic_modifier_keys_reset.xml @@ -21,7 +21,7 @@ android:height="24.0dp" android:viewportWidth="24.0" android:viewportHeight="24.0" - android:tint="?androidprv:attr/materialColorPrimary"> + android:tint="@androidprv:color/materialColorPrimary"> diff --git a/res/drawable/ic_star_24dp.xml b/res/drawable/ic_star_24dp.xml index 667db94e0fd..449067875c4 100644 --- a/res/drawable/ic_star_24dp.xml +++ b/res/drawable/ic_star_24dp.xml @@ -21,6 +21,6 @@ android:viewportHeight="24" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/modifier_key_bordered.xml b/res/drawable/modifier_key_bordered.xml index 2931679685d..a3c7cc5d318 100644 --- a/res/drawable/modifier_key_bordered.xml +++ b/res/drawable/modifier_key_bordered.xml @@ -25,7 +25,7 @@ + android:color="@androidprv:color/materialColorPrimary"/> diff --git a/res/drawable/modifier_key_colored.xml b/res/drawable/modifier_key_colored.xml index 995d7336564..4610738127e 100644 --- a/res/drawable/modifier_key_colored.xml +++ b/res/drawable/modifier_key_colored.xml @@ -22,7 +22,7 @@ - + diff --git a/res/drawable/modifier_key_lisetview_background.xml b/res/drawable/modifier_key_lisetview_background.xml index 3353cfdaab2..a0d8c03bfac 100644 --- a/res/drawable/modifier_key_lisetview_background.xml +++ b/res/drawable/modifier_key_lisetview_background.xml @@ -22,7 +22,7 @@ - + diff --git a/res/drawable/pointer_icon_fill_container_background.xml b/res/drawable/pointer_icon_fill_container_background.xml index ca930a74540..7f6bf533073 100644 --- a/res/drawable/pointer_icon_fill_container_background.xml +++ b/res/drawable/pointer_icon_fill_container_background.xml @@ -18,5 +18,5 @@ xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" android:shape="rectangle"> - + diff --git a/res/drawable/preference_circular_icons_plus_item_background.xml b/res/drawable/preference_circular_icons_plus_item_background.xml index faaa1fd11fe..e261c76af46 100644 --- a/res/drawable/preference_circular_icons_plus_item_background.xml +++ b/res/drawable/preference_circular_icons_plus_item_background.xml @@ -21,5 +21,5 @@ - + \ No newline at end of file diff --git a/res/drawable/rounded_bg.xml b/res/drawable/rounded_bg.xml index ae12af895dc..0e2743de1c3 100644 --- a/res/drawable/rounded_bg.xml +++ b/res/drawable/rounded_bg.xml @@ -17,7 +17,7 @@ - + - + android:color="@androidprv:color/materialColorPrimary"/> diff --git a/res/drawable/trackpad_button_done_colored.xml b/res/drawable/trackpad_button_done_colored.xml index 995d7336564..4610738127e 100644 --- a/res/drawable/trackpad_button_done_colored.xml +++ b/res/drawable/trackpad_button_done_colored.xml @@ -22,7 +22,7 @@ - + diff --git a/res/drawable/user_select_background.xml b/res/drawable/user_select_background.xml index 7b75160213d..490246c49fe 100644 --- a/res/drawable/user_select_background.xml +++ b/res/drawable/user_select_background.xml @@ -19,13 +19,13 @@ android:color="@color/settingslib_ripple_color"> - + - + diff --git a/res/drawable/volume_dialog_button_background_outline.xml b/res/drawable/volume_dialog_button_background_outline.xml index 36ffb93f7a4..f8df90e604b 100644 --- a/res/drawable/volume_dialog_button_background_outline.xml +++ b/res/drawable/volume_dialog_button_background_outline.xml @@ -21,7 +21,7 @@ + android:textColor="@androidprv:color/materialColorOnSurface"/> + android:textColor="@androidprv:color/materialColorOnSurface"/> + android:textColor="@androidprv:color/materialColorOnSurface"/> + android:tint="@androidprv:color/materialColorPrimary"/> diff --git a/res/layout/notification_ls_minimalism_selector.xml b/res/layout/notification_ls_minimalism_selector.xml index d37ad5401a2..cf34561082d 100644 --- a/res/layout/notification_ls_minimalism_selector.xml +++ b/res/layout/notification_ls_minimalism_selector.xml @@ -74,7 +74,7 @@ android:singleLine="true" android:textSize="@dimen/contrast_button_text_size" android:text="@string/lock_screen_notifs_show_compact" - android:textColor="?androidprv:attr/materialColorOnSurface"/> + android:textColor="@androidprv:color/materialColorOnSurface"/> + android:textColor="@androidprv:color/materialColorOnSurface"/> diff --git a/res/layout/pointer_icon_stroke_style_layout.xml b/res/layout/pointer_icon_stroke_style_layout.xml index 01b58b294ce..a68b5967357 100644 --- a/res/layout/pointer_icon_stroke_style_layout.xml +++ b/res/layout/pointer_icon_stroke_style_layout.xml @@ -31,7 +31,7 @@ android:layout_marginTop="@dimen/pointer_stroke_style_padding" android:text="@string/pointer_stroke_style" android:textSize="14sp" - android:textColor="?androidprv:attr/materialColorPrimary" + android:textColor="@androidprv:color/materialColorPrimary" android:textAlignment="viewStart" android:fontWeight="500" android:textAppearance="?android:attr/textAppearanceListItem" /> diff --git a/res/layout/preference_background.xml b/res/layout/preference_background.xml index 51718b8fd5c..1c69be4ac7e 100644 --- a/res/layout/preference_background.xml +++ b/res/layout/preference_background.xml @@ -65,7 +65,7 @@ android:layout_height="wrap_content" android:singleLine="true" android:textAppearance="?android:attr/textAppearanceListItem" - android:textColor="?androidprv:attr/materialColorOnPrimaryContainer" + android:textColor="@androidprv:color/materialColorOnPrimaryContainer" android:ellipsize="marquee" android:fadingEdge="horizontal" android:hyphenationFrequency="normalFast" @@ -78,7 +78,7 @@ android:layout_alignStart="@android:id/title" android:layout_alignLeft="@android:id/title" android:textAppearance="?android:attr/textAppearanceSmall" - android:textColor="?androidprv:attr/materialColorOnPrimaryContainer" + android:textColor="@androidprv:color/materialColorOnPrimaryContainer" android:hyphenationFrequency="normalFast" android:lineBreakWordStyle="phrase" android:maxLines="4" diff --git a/res/layout/preference_circular_icons_plus_item.xml b/res/layout/preference_circular_icons_plus_item.xml index 98820863410..352708806b7 100644 --- a/res/layout/preference_circular_icons_plus_item.xml +++ b/res/layout/preference_circular_icons_plus_item.xml @@ -26,7 +26,7 @@ android:padding="4dp" android:drawablePadding="0dp" android:background="@drawable/preference_circular_icons_plus_item_background" - android:textColor="?androidprv:attr/materialColorOnSecondaryContainer" + android:textColor="@androidprv:color/materialColorOnSecondaryContainer" android:maxLines="1" android:autoSizeTextType="uniform" android:autoSizeMinTextSize="6sp" /> \ No newline at end of file diff --git a/res/layout/preference_widget_arrow.xml b/res/layout/preference_widget_arrow.xml index f36f693f012..50edb3c0bd6 100644 --- a/res/layout/preference_widget_arrow.xml +++ b/res/layout/preference_widget_arrow.xml @@ -23,5 +23,5 @@ android:layout_gravity="center_vertical" android:contentDescription="@null" android:scaleType="center" - android:tint="?androidprv:attr/materialColorOnPrimaryContainer" + android:tint="@androidprv:color/materialColorOnPrimaryContainer" android:src="@drawable/ic_arrow_forward" /> \ No newline at end of file diff --git a/res/layout/trackpad_gesture_preview.xml b/res/layout/trackpad_gesture_preview.xml index 15cc743196d..978da06319c 100644 --- a/res/layout/trackpad_gesture_preview.xml +++ b/res/layout/trackpad_gesture_preview.xml @@ -82,7 +82,7 @@ android:paddingVertical="14dp" android:drawablePadding="9dp" style="@style/TrackpadButtonDone" - android:textColor="?androidprv:attr/materialColorOnPrimary" + android:textColor="@androidprv:color/materialColorOnPrimary" android:text="@string/gesture_button_next"/>