Merge changes from topic "theme-update" into udc-dev

* changes:
  Fix contrast of monochrome fixed colors
  Fix contrast levels of outline and outline_variant
This commit is contained in:
Lucas Dupin
2023-05-30 18:33:45 +00:00
committed by Android (Google) Code Review
3 changed files with 538 additions and 484 deletions

View File

@@ -18,10 +18,11 @@ package com.android.systemui.theme
import android.util.Pair
import com.android.systemui.monet.dynamiccolor.DynamicColor
import com.android.systemui.monet.dynamiccolor.MaterialDynamicColors as MDC
import com.android.systemui.monet.dynamiccolor.MaterialDynamicColors
class DynamicColors {
companion object {
private val MDC = MaterialDynamicColors()
@JvmField
val ALL_DYNAMIC_COLORS_MAPPED: List<Pair<String, DynamicColor>> =
arrayListOf(

View File

@@ -659,6 +659,7 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
Resources res = userHandle.isSystem()
? mResources : mContext.createContextAsUser(userHandle, 0).getResources();
Resources.Theme theme = mContext.getTheme();
MaterialDynamicColors dynamicColors = new MaterialDynamicColors();
if (!(res.getColor(android.R.color.system_accent1_500, theme)
== mColorScheme.getAccent1().getS500()
&& res.getColor(android.R.color.system_accent2_500, theme)
@@ -670,15 +671,15 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
&& res.getColor(android.R.color.system_neutral2_500, theme)
== mColorScheme.getNeutral2().getS500()
&& res.getColor(android.R.color.system_outline_variant_dark, theme)
== MaterialDynamicColors.outlineVariant().getArgb(mDynamicSchemeDark)
== dynamicColors.outlineVariant().getArgb(mDynamicSchemeDark)
&& res.getColor(android.R.color.system_outline_variant_light, theme)
== MaterialDynamicColors.outlineVariant().getArgb(mDynamicSchemeLight)
== dynamicColors.outlineVariant().getArgb(mDynamicSchemeLight)
&& res.getColor(android.R.color.system_primary_container_dark, theme)
== MaterialDynamicColors.primaryContainer().getArgb(mDynamicSchemeDark)
== dynamicColors.primaryContainer().getArgb(mDynamicSchemeDark)
&& res.getColor(android.R.color.system_primary_container_light, theme)
== MaterialDynamicColors.primaryContainer().getArgb(mDynamicSchemeLight)
== dynamicColors.primaryContainer().getArgb(mDynamicSchemeLight)
&& res.getColor(android.R.color.system_primary_fixed, theme)
== MaterialDynamicColors.primaryFixed().getArgb(mDynamicSchemeLight))) {
== dynamicColors.primaryFixed().getArgb(mDynamicSchemeLight))) {
return false;
}
}