Merge "[tp] More actionable reenablement dialogs for quick affordances." into udc-dev
diff --git a/res/drawable/picker_fragment_background.xml b/res/drawable/picker_fragment_background.xml
index 3a49d7a..49fa48b 100644
--- a/res/drawable/picker_fragment_background.xml
+++ b/res/drawable/picker_fragment_background.xml
@@ -16,5 +16,5 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="28dp" />
- <solid android:color="@color/color_surface" />
+ <solid android:color="@color/picker_fragment_background" />
</shape>
diff --git a/res/layout/fragment_clock_settings.xml b/res/layout/fragment_clock_settings.xml
index 23fbfb8..bb4a0c2 100644
--- a/res/layout/fragment_clock_settings.xml
+++ b/res/layout/fragment_clock_settings.xml
@@ -46,6 +46,7 @@
<com.android.customization.picker.clock.ui.view.ClockHostView
android:id="@+id/clock_host_view"
+ android:importantForAccessibility="noHideDescendants"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center" />
diff --git a/src/com/android/customization/model/color/ColorProvider.kt b/src/com/android/customization/model/color/ColorProvider.kt
index 6c83f23..63d298d 100644
--- a/src/com/android/customization/model/color/ColorProvider.kt
+++ b/src/com/android/customization/model/color/ColorProvider.kt
@@ -329,28 +329,68 @@
/**
* Returns the light theme version of the Revamped UI preview of a ColorScheme based on this
* order: top left, top right, bottom left, bottom right
+ *
+ * This color mapping corresponds to GM3 colors: Primary (light), Primary (light), Secondary
+ * LStar 85, and Tertiary LStar 70
*/
@ColorInt
private fun getRevampedUILightColorPreview(colorScheme: ColorScheme): IntArray {
return intArrayOf(
setAlphaComponent(colorScheme.accent1.s600, ALPHA_MASK),
setAlphaComponent(colorScheme.accent1.s600, ALPHA_MASK),
- setAlphaComponent(colorScheme.accent2.s100, ALPHA_MASK),
- ColorStateList.valueOf(colorScheme.accent3.s500).withLStar(59f).colors[0],
+ ColorStateList.valueOf(colorScheme.accent2.s500).withLStar(85f).colors[0],
+ setAlphaComponent(colorScheme.accent3.s300, ALPHA_MASK),
)
}
/**
* Returns the dark theme version of the Revamped UI preview of a ColorScheme based on this
* order: top left, top right, bottom left, bottom right
+ *
+ * This color mapping corresponds to GM3 colors: Primary (dark), Primary (dark), Secondary LStar
+ * 35, and Tertiary LStar 70
*/
@ColorInt
private fun getRevampedUIDarkColorPreview(colorScheme: ColorScheme): IntArray {
return intArrayOf(
setAlphaComponent(colorScheme.accent1.s200, ALPHA_MASK),
setAlphaComponent(colorScheme.accent1.s200, ALPHA_MASK),
- setAlphaComponent(colorScheme.accent2.s700, ALPHA_MASK),
- setAlphaComponent(colorScheme.accent3.s100, ALPHA_MASK),
+ ColorStateList.valueOf(colorScheme.accent2.s500).withLStar(35f).colors[0],
+ setAlphaComponent(colorScheme.accent3.s300, ALPHA_MASK),
+ )
+ }
+
+ /**
+ * Returns the light theme version of the Revamped UI preview of a ColorScheme based on this
+ * order: top left, top right, bottom left, bottom right
+ *
+ * This color mapping corresponds to GM3 colors: Primary LStar 0, Primary LStar 0, Secondary
+ * LStar 85, and Tertiary LStar 70
+ */
+ @ColorInt
+ private fun getRevampedUILightMonochromePreview(colorScheme: ColorScheme): IntArray {
+ return intArrayOf(
+ setAlphaComponent(colorScheme.accent1.s1000, ALPHA_MASK),
+ setAlphaComponent(colorScheme.accent1.s1000, ALPHA_MASK),
+ ColorStateList.valueOf(colorScheme.accent2.s500).withLStar(85f).colors[0],
+ setAlphaComponent(colorScheme.accent3.s300, ALPHA_MASK),
+ )
+ }
+
+ /**
+ * Returns the dark theme version of the Revamped UI preview of a ColorScheme based on this
+ * order: top left, top right, bottom left, bottom right
+ *
+ * This color mapping corresponds to GM3 colors: Primary LStar 99, Primary LStar 99, Secondary
+ * LStar 35, and Tertiary LStar 70
+ */
+ @ColorInt
+ private fun getRevampedUIDarkMonochromePreview(colorScheme: ColorScheme): IntArray {
+ return intArrayOf(
+ setAlphaComponent(colorScheme.accent1.s10, ALPHA_MASK),
+ setAlphaComponent(colorScheme.accent1.s10, ALPHA_MASK),
+ ColorStateList.valueOf(colorScheme.accent2.s500).withLStar(35f).colors[0],
+ setAlphaComponent(colorScheme.accent3.s300, ALPHA_MASK),
)
}
@@ -513,8 +553,8 @@
when (style) {
Style.MONOCHROMATIC -> {
- darkColors = getRevampedUIDarkColorPreview(darkColorScheme)
- lightColors = getRevampedUILightColorPreview(lightColorScheme)
+ darkColors = getRevampedUIDarkMonochromePreview(darkColorScheme)
+ lightColors = getRevampedUILightMonochromePreview(lightColorScheme)
}
else -> {
darkColors = getRevampedUIPresetColorPreview(darkColorScheme, colorFromStub)