Fixed contrast with sfps overlay.

Tested various different themes

1. Choose a color in settings > wallpapers > basic colors
2. Go through enrollment
3. Verify that light/dark theme have appropriate contrast.

Test: Manually verified the contrast works for light/dark themes and
various different basic color styles.
Fixes: 243008680

Change-Id: I63900a8df21a3fe0f02e5da0db6e3b75520fce12
This commit is contained in:
Joshua McCloskey
2022-12-01 17:34:21 +00:00
parent 6303152e0a
commit 9e3c21bae5
2 changed files with 7 additions and 0 deletions

View File

@@ -133,6 +133,9 @@
<color name="biometric_dialog_accent">@color/material_dynamic_primary40</color>
<color name="biometric_dialog_error">#ffd93025</color> <!-- red 600 -->
<!-- SFPS colors -->
<color name="sfps_chevron_fill">@color/material_dynamic_primary90</color>
<!-- UDFPS colors -->
<color name="udfps_enroll_icon">#699FF3</color>
<color name="udfps_moving_target_fill">#C2D7F7</color>

View File

@@ -370,11 +370,15 @@ private fun WindowInsets.hasBigNavigationBar(): Boolean =
private fun LottieAnimationView.addOverlayDynamicColor(context: Context) {
fun update() {
val c = context.getColor(R.color.biometric_dialog_accent)
val chevronFill = context.getColor(R.color.sfps_chevron_fill)
for (key in listOf(".blue600", ".blue400")) {
addValueCallback(KeyPath(key, "**"), LottieProperty.COLOR_FILTER) {
PorterDuffColorFilter(c, PorterDuff.Mode.SRC_ATOP)
}
}
addValueCallback(KeyPath(".black", "**"), LottieProperty.COLOR_FILTER) {
PorterDuffColorFilter(chevronFill, PorterDuff.Mode.SRC_ATOP)
}
}
if (composition != null) {