Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1202fb5 authored by Marcelo Arteiro's avatar Marcelo Arteiro
Browse files

Aligning Android color tokens with Material

Since this is a change that happens a couple times a year, we also updated the script that generates XML so we can easily update resource files in the future.

Because names now follow closely on Material, and now resources are alphabetically sorted, many lines are being shuffled.
With this new sorting, future updates would look much cleaner and easier to read.
In this update we are adding only 12 public color resources that are already in place in Material and need their counterparts here in Android. These are:

```
inverse_on_surface_light
inverse_primary_light
inverse_surface_light
scrim_light
shadow_light
surface_tint_light
inverse_on_surface_dark
inverse_primary_dark
inverse_surface_dark
scrim_dark
shadow_dark
surface_tint_dark
```

Regarding the dynamic private (0p only) attributes, the updates are just in the renaming of tokens. Like so:
```
OnSurfaceInverse -> InverseOnSurface
PrimaryInverse -> InversePrimary
SurfaceInverse -> InverseSurface
```

All dynamic attributes are will be removed in following CL and their usages will be replaced by color resources that are theme independent.  For this reason the new private color resource are already being created in this change, but the attribute are kept for now, avoiding breaking changes.

Bug: 376195115
Bug: 241778903
Test: presubmits
Flag: com.android.systemui.material_colors_10_2024

Change-Id: Ief5c983336bbd822e0639f14cc57ab5680490572
parent dd5840f5
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -2043,6 +2043,12 @@ package android {
    field public static final int system_error_container_light = 17170554; // 0x106007a
    field public static final int system_error_dark = 17170595; // 0x10600a3
    field public static final int system_error_light = 17170552; // 0x1060078
    field @FlaggedApi("com.android.systemui.material_colors_10_2024") public static final int system_inverse_on_surface_dark;
    field @FlaggedApi("com.android.systemui.material_colors_10_2024") public static final int system_inverse_on_surface_light;
    field @FlaggedApi("com.android.systemui.material_colors_10_2024") public static final int system_inverse_primary_dark;
    field @FlaggedApi("com.android.systemui.material_colors_10_2024") public static final int system_inverse_primary_light;
    field @FlaggedApi("com.android.systemui.material_colors_10_2024") public static final int system_inverse_surface_dark;
    field @FlaggedApi("com.android.systemui.material_colors_10_2024") public static final int system_inverse_surface_light;
    field public static final int system_neutral1_0 = 17170461; // 0x106001d
    field public static final int system_neutral1_10 = 17170462; // 0x106001e
    field public static final int system_neutral1_100 = 17170464; // 0x1060020
@@ -2119,12 +2125,16 @@ package android {
    field public static final int system_primary_fixed = 17170612; // 0x10600b4
    field public static final int system_primary_fixed_dim = 17170613; // 0x10600b5
    field public static final int system_primary_light = 17170528; // 0x1060060
    field @FlaggedApi("com.android.systemui.material_colors_10_2024") public static final int system_scrim_dark;
    field @FlaggedApi("com.android.systemui.material_colors_10_2024") public static final int system_scrim_light;
    field public static final int system_secondary_container_dark = 17170573; // 0x106008d
    field public static final int system_secondary_container_light = 17170530; // 0x1060062
    field public static final int system_secondary_dark = 17170575; // 0x106008f
    field public static final int system_secondary_fixed = 17170616; // 0x10600b8
    field public static final int system_secondary_fixed_dim = 17170617; // 0x10600b9
    field public static final int system_secondary_light = 17170532; // 0x1060064
    field @FlaggedApi("com.android.systemui.material_colors_10_2024") public static final int system_shadow_dark;
    field @FlaggedApi("com.android.systemui.material_colors_10_2024") public static final int system_shadow_light;
    field public static final int system_surface_bright_dark = 17170590; // 0x106009e
    field public static final int system_surface_bright_light = 17170547; // 0x1060073
    field public static final int system_surface_container_dark = 17170587; // 0x106009b
@@ -2142,6 +2152,8 @@ package android {
    field public static final int system_surface_dim_light = 17170548; // 0x1060074
    field public static final int system_surface_disabled = 17170626; // 0x10600c2
    field public static final int system_surface_light = 17170540; // 0x106006c
    field @FlaggedApi("com.android.systemui.material_colors_10_2024") public static final int system_surface_tint_dark;
    field @FlaggedApi("com.android.systemui.material_colors_10_2024") public static final int system_surface_tint_light;
    field public static final int system_surface_variant_dark = 17170592; // 0x10600a0
    field public static final int system_surface_variant_light = 17170549; // 0x1060075
    field public static final int system_tertiary_container_dark = 17170577; // 0x1060091
+103 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2024 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.
-->

<!-- Colors specific to Material themes. -->
<resources>
    <color name="materialColorBackground">@color/system_background_dark</color>
    <color name="materialColorControlActivated">@color/system_control_activated_dark</color>
    <color name="materialColorControlHighlight">@color/system_control_highlight_dark</color>
    <color name="materialColorControlNormal">@color/system_control_normal_dark</color>
    <color name="materialColorError">@color/system_error_dark</color>
    <color name="materialColorErrorContainer">@color/system_error_container_dark</color>
    <color name="materialColorInverseOnSurface">@color/system_inverse_on_surface_dark</color>
    <color name="materialColorInversePrimary">@color/system_inverse_primary_dark</color>
    <color name="materialColorInverseSurface">@color/system_inverse_surface_dark</color>
    <color name="materialColorOnBackground">@color/system_on_background_dark</color>
    <color name="materialColorOnError">@color/system_on_error_dark</color>
    <color name="materialColorOnErrorContainer">@color/system_on_error_container_dark</color>
    <color name="materialColorOnPrimary">@color/system_on_primary_dark</color>
    <color name="materialColorOnPrimaryContainer">@color/system_on_primary_container_dark</color>
    <color name="materialColorOnSecondary">@color/system_on_secondary_dark</color>
    <color name="materialColorOnSecondaryContainer">@color/system_on_secondary_container_dark</color>
    <color name="materialColorOnSurface">@color/system_on_surface_dark</color>
    <color name="materialColorOnSurfaceVariant">@color/system_on_surface_variant_dark</color>
    <color name="materialColorOnTertiary">@color/system_on_tertiary_dark</color>
    <color name="materialColorOnTertiaryContainer">@color/system_on_tertiary_container_dark</color>
    <color name="materialColorOutline">@color/system_outline_dark</color>
    <color name="materialColorOutlineVariant">@color/system_outline_variant_dark</color>
    <color name="materialColorPaletteKeyColorNeutral">@color/system_palette_key_color_neutral_dark</color>
    <color name="materialColorPaletteKeyColorNeutralVariant">@color/system_palette_key_color_neutral_variant_dark</color>
    <color name="materialColorPaletteKeyColorPrimary">@color/system_palette_key_color_primary_dark</color>
    <color name="materialColorPaletteKeyColorSecondary">@color/system_palette_key_color_secondary_dark</color>
    <color name="materialColorPaletteKeyColorTertiary">@color/system_palette_key_color_tertiary_dark</color>
    <color name="materialColorPrimary">@color/system_primary_dark</color>
    <color name="materialColorPrimaryContainer">@color/system_primary_container_dark</color>
    <color name="materialColorScrim">@color/system_scrim_dark</color>
    <color name="materialColorSecondary">@color/system_secondary_dark</color>
    <color name="materialColorSecondaryContainer">@color/system_secondary_container_dark</color>
    <color name="materialColorShadow">@color/system_shadow_dark</color>
    <color name="materialColorSurface">@color/system_surface_dark</color>
    <color name="materialColorSurfaceBright">@color/system_surface_bright_dark</color>
    <color name="materialColorSurfaceContainer">@color/system_surface_container_dark</color>
    <color name="materialColorSurfaceContainerHigh">@color/system_surface_container_high_dark</color>
    <color name="materialColorSurfaceContainerHighest">@color/system_surface_container_highest_dark</color>
    <color name="materialColorSurfaceContainerLow">@color/system_surface_container_low_dark</color>
    <color name="materialColorSurfaceContainerLowest">@color/system_surface_container_lowest_dark</color>
    <color name="materialColorSurfaceDim">@color/system_surface_dim_dark</color>
    <color name="materialColorSurfaceTint">@color/system_surface_tint_dark</color>
    <color name="materialColorSurfaceVariant">@color/system_surface_variant_dark</color>
    <color name="materialColorTertiary">@color/system_tertiary_dark</color>
    <color name="materialColorTertiaryContainer">@color/system_tertiary_container_dark</color>
    <color name="materialColorTextHintInverse">@color/system_text_hint_inverse_dark</color>
    <color name="materialColorTextPrimaryInverse">@color/system_text_primary_inverse_dark</color>
    <color name="materialColorTextPrimaryInverseDisableOnly">@color/system_text_primary_inverse_disable_only_dark</color>
    <color name="materialColorTextSecondaryAndTertiaryInverse">@color/system_text_secondary_and_tertiary_inverse_dark</color>
    <color name="materialColorTextSecondaryAndTertiaryInverseDisabled">@color/system_text_secondary_and_tertiary_inverse_disabled_dark</color>
    <color name="materialColorOnPrimaryFixed">@color/system_on_primary_fixed</color>
    <color name="materialColorOnPrimaryFixedVariant">@color/system_on_primary_fixed_variant</color>
    <color name="materialColorOnSecondaryFixed">@color/system_on_secondary_fixed</color>
    <color name="materialColorOnSecondaryFixedVariant">@color/system_on_secondary_fixed_variant</color>
    <color name="materialColorOnTertiaryFixed">@color/system_on_tertiary_fixed</color>
    <color name="materialColorOnTertiaryFixedVariant">@color/system_on_tertiary_fixed_variant</color>
    <color name="materialColorPrimaryFixed">@color/system_primary_fixed</color>
    <color name="materialColorPrimaryFixedDim">@color/system_primary_fixed_dim</color>
    <color name="materialColorSecondaryFixed">@color/system_secondary_fixed</color>
    <color name="materialColorSecondaryFixedDim">@color/system_secondary_fixed_dim</color>
    <color name="materialColorTertiaryFixed">@color/system_tertiary_fixed</color>
    <color name="materialColorTertiaryFixedDim">@color/system_tertiary_fixed_dim</color>
    <color name="customColorBrandA">@color/system_brand_a_dark</color>
    <color name="customColorBrandB">@color/system_brand_b_dark</color>
    <color name="customColorBrandC">@color/system_brand_c_dark</color>
    <color name="customColorBrandD">@color/system_brand_d_dark</color>
    <color name="customColorClockHour">@color/system_clock_hour_dark</color>
    <color name="customColorClockMinute">@color/system_clock_minute_dark</color>
    <color name="customColorClockSecond">@color/system_clock_second_dark</color>
    <color name="customColorOnShadeActive">@color/system_on_shade_active_dark</color>
    <color name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</color>
    <color name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</color>
    <color name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</color>
    <color name="customColorOnThemeApp">@color/system_on_theme_app_dark</color>
    <color name="customColorOverviewBackground">@color/system_overview_background_dark</color>
    <color name="customColorShadeActive">@color/system_shade_active_dark</color>
    <color name="customColorShadeDisabled">@color/system_shade_disabled_dark</color>
    <color name="customColorShadeInactive">@color/system_shade_inactive_dark</color>
    <color name="customColorThemeApp">@color/system_theme_app_dark</color>
    <color name="customColorThemeAppRing">@color/system_theme_app_ring_dark</color>
    <color name="customColorThemeNotif">@color/system_theme_notif_dark</color>
    <color name="customColorUnderSurface">@color/system_under_surface_dark</color>
    <color name="customColorWeatherTemp">@color/system_weather_temp_dark</color>
    <color name="customColorWidgetBackground">@color/system_widget_background_dark</color>
</resources>
+3 −3
Original line number Diff line number Diff line
@@ -238,16 +238,16 @@ a similar way.
        <item name="materialColorSecondaryFixedDim">@color/system_secondary_fixed_dim</item>
        <item name="materialColorOnErrorContainer">@color/system_on_error_container_dark</item>
        <item name="materialColorOnSecondaryFixed">@color/system_on_secondary_fixed</item>
        <item name="materialColorOnSurfaceInverse">@color/system_on_surface_light</item>
        <item name="materialColorInverseOnSurface">@color/system_on_surface_light</item>
        <item name="materialColorTertiaryFixedDim">@color/system_tertiary_fixed_dim</item>
        <item name="materialColorOnTertiaryFixed">@color/system_on_tertiary_fixed</item>
        <item name="materialColorPrimaryFixedDim">@color/system_primary_fixed_dim</item>
        <item name="materialColorSecondaryContainer">@color/system_secondary_container_dark</item>
        <item name="materialColorErrorContainer">@color/system_error_container_dark</item>
        <item name="materialColorOnPrimaryFixed">@color/system_on_primary_fixed</item>
        <item name="materialColorPrimaryInverse">@color/system_primary_light</item>
        <item name="materialColorInversePrimary">@color/system_primary_light</item>
        <item name="materialColorSecondaryFixed">@color/system_secondary_fixed</item>
        <item name="materialColorSurfaceInverse">@color/system_surface_light</item>
        <item name="materialColorInverseSurface">@color/system_surface_light</item>
        <item name="materialColorSurfaceVariant">@color/system_surface_variant_dark</item>
        <item name="materialColorTertiaryContainer">@color/system_tertiary_container_dark</item>
        <item name="materialColorTertiaryFixed">@color/system_tertiary_fixed</item>
+132 −137

File changed.

Preview size limit exceeded, changes collapsed.

+199 −273

File changed.

Preview size limit exceeded, changes collapsed.

Loading