diff options
| author | 2025-01-22 13:06:51 -0800 | |
|---|---|---|
| committer | 2025-01-22 13:06:51 -0800 | |
| commit | c06d1334fe6d888233f2959b7d8a5e86bf3a89bc (patch) | |
| tree | 8a965e7f180d26d8a9abbc918258f89bac509747 | |
| parent | c305b5b27e4c12bf6dcb6fa5a023642a805c91d6 (diff) | |
| parent | 070c883bfe3493b7e5fc8e803a623b43d6a23a9e (diff) | |
Merge "Color Tokens for notification rows, and other surfaces." into main
9 files changed, 156 insertions, 0 deletions
diff --git a/core/res/res/color-night/surface_effect_0_color.xml b/core/res/res/color-night/surface_effect_0_color.xml new file mode 100644 index 000000000000..f71ed46cc014 --- /dev/null +++ b/core/res/res/color-night/surface_effect_0_color.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + ~ Copyright (C) 2025 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_accent1_800" + android:alpha="0.5"/> +</selector> diff --git a/core/res/res/color-night/surface_effect_1_color.xml b/core/res/res/color-night/surface_effect_1_color.xml new file mode 100644 index 000000000000..80b95ae31d1c --- /dev/null +++ b/core/res/res/color-night/surface_effect_1_color.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + ~ Copyright (C) 2025 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_500" + android:lStar="6" android:alpha="0.54"/> +</selector> diff --git a/core/res/res/color/surface_effect_0_color.xml b/core/res/res/color/surface_effect_0_color.xml new file mode 100644 index 000000000000..b6a607c6ee5e --- /dev/null +++ b/core/res/res/color/surface_effect_0_color.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + ~ Copyright (C) 2025 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_accent1_100" + android:alpha="0.5"/> +</selector> diff --git a/core/res/res/color/surface_effect_1_color.xml b/core/res/res/color/surface_effect_1_color.xml new file mode 100644 index 000000000000..332130ae6f91 --- /dev/null +++ b/core/res/res/color/surface_effect_1_color.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + ~ Copyright (C) 2025 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_500" + android:lStar="98" android:alpha="0.54"/> +</selector> diff --git a/core/res/res/values-night/colors.xml b/core/res/res/values-night/colors.xml index d3f998fb70cf..7b9b2d666292 100644 --- a/core/res/res/values-night/colors.xml +++ b/core/res/res/values-night/colors.xml @@ -47,6 +47,10 @@ <color name="language_picker_item_selected_bg">#92B3F2</color> <color name="language_picker_item_selected_stroke">#185ABC</color> + <!-- Color for various surfaces related to system-wide blur --> + <color name="surface_effect_0">@color/surface_effect_0_color</color> + <color name="surface_effect_1">@color/surface_effect_1_color</color> + <!-- Color for side fps toast dark theme--> <color name="side_fps_toast_background">#2E3132</color> <color name="side_fps_text_color">#EFF1F2</color> diff --git a/core/res/res/values/colors.xml b/core/res/res/values/colors.xml index 13dd4a35564c..864daf9d2072 100644 --- a/core/res/res/values/colors.xml +++ b/core/res/res/values/colors.xml @@ -582,6 +582,10 @@ <color name="side_fps_text_color">#191C1D</color> <color name="side_fps_button_color">#00677E</color> + <!-- Color for various surfaces related to system-wide blur --> + <color name="surface_effect_0">@color/surface_effect_0_color</color> + <color name="surface_effect_1">@color/surface_effect_1_color</color> + <!-- Color for system bars --> <color name="navigation_bar_compatible">@android:color/black</color> <!-- This uses non-regular transparent intentionally. It is used to tell if the transparent diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 6890a4156b75..8315e3cf1a11 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -532,6 +532,8 @@ <java-symbol type="bool" name="config_enableUdcSysfsUsbStateUpdate"/> <java-symbol type="bool" name="config_enableSearchTileHideIllustrationInPrivateSpace"/> + <java-symbol type="color" name="surface_effect_0" /> + <java-symbol type="color" name="surface_effect_1" /> <java-symbol type="color" name="tab_indicator_text_v4" /> <java-symbol type="dimen" name="accessibility_touch_slop" /> diff --git a/packages/SystemUI/src/com/android/systemui/common/shared/colors/ShadeColors.kt b/packages/SystemUI/src/com/android/systemui/common/shared/colors/ShadeColors.kt new file mode 100644 index 000000000000..70ace6a6d038 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/common/shared/colors/ShadeColors.kt @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2025 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. + */ + +package com.android.systemui.common.shared.colors + +import android.content.res.Resources +import android.graphics.Color +import com.android.internal.graphics.ColorUtils +import com.android.systemui.res.R + +object ShadeColors { + @JvmStatic + fun Resources.shadeBasePanel(): Int { + val layerAbove = + ColorUtils.setAlphaComponent(getColor(R.color.shade_panel), (0.4f * 255).toInt()) + val layerBelow = ColorUtils.setAlphaComponent(Color.WHITE, (0.1f * 255).toInt()) + return ColorUtils.compositeColors(layerAbove, layerBelow) + } +} diff --git a/packages/SystemUI/src/com/android/systemui/common/shared/colors/SurfaceEffectColors.kt b/packages/SystemUI/src/com/android/systemui/common/shared/colors/SurfaceEffectColors.kt new file mode 100644 index 000000000000..d4027c029a0a --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/common/shared/colors/SurfaceEffectColors.kt @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2025 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. + */ + +package com.android.systemui.common.shared.colors + +import android.content.res.Resources +import android.graphics.Color +import com.android.internal.graphics.ColorUtils +import com.android.systemui.res.R + +object SurfaceEffectColors { + @JvmStatic + fun Resources.surfaceEffect0(): Int { + return getColor(com.android.internal.R.color.surface_effect_0) + } + + @JvmStatic + fun Resources.surfaceEffect1(): Int { + return getColor(com.android.internal.R.color.surface_effect_1) + } +} |