Merge "Update keyguard fingerprint & face scanning colors" into udc-dev

This commit is contained in:
Beverly Tai
2023-05-12 22:13:25 +00:00
committed by Android (Google) Code Review
5 changed files with 22 additions and 17 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -31,10 +31,10 @@ import android.graphics.RectF
import android.hardware.biometrics.BiometricSourceType import android.hardware.biometrics.BiometricSourceType
import android.view.View import android.view.View
import androidx.core.graphics.ColorUtils import androidx.core.graphics.ColorUtils
import com.android.app.animation.Interpolators
import com.android.keyguard.KeyguardUpdateMonitor import com.android.keyguard.KeyguardUpdateMonitor
import com.android.keyguard.KeyguardUpdateMonitorCallback import com.android.keyguard.KeyguardUpdateMonitorCallback
import com.android.settingslib.Utils import com.android.settingslib.Utils
import com.android.app.animation.Interpolators
import com.android.systemui.biometrics.AuthController import com.android.systemui.biometrics.AuthController
import com.android.systemui.log.ScreenDecorationsLogger import com.android.systemui.log.ScreenDecorationsLogger
import com.android.systemui.plugins.statusbar.StatusBarStateController import com.android.systemui.plugins.statusbar.StatusBarStateController
@@ -63,7 +63,7 @@ class FaceScanningOverlay(
private var cameraProtectionColor = Color.BLACK private var cameraProtectionColor = Color.BLACK
var faceScanningAnimColor = Utils.getColorAttrDefaultColor(context, var faceScanningAnimColor = Utils.getColorAttrDefaultColor(context,
R.attr.wallpaperTextColorAccent) com.android.internal.R.attr.materialColorPrimaryFixed)
private var cameraProtectionAnimator: ValueAnimator? = null private var cameraProtectionAnimator: ValueAnimator? = null
var hideOverlayRunnable: Runnable? = null var hideOverlayRunnable: Runnable? = null
var faceAuthSucceeded = false var faceAuthSucceeded = false

View File

@@ -20,7 +20,6 @@ import android.animation.AnimatorListenerAdapter
import android.app.ActivityTaskManager import android.app.ActivityTaskManager
import android.content.Context import android.content.Context
import android.content.res.Configuration import android.content.res.Configuration
import android.graphics.Color
import android.graphics.PixelFormat import android.graphics.PixelFormat
import android.graphics.PorterDuff import android.graphics.PorterDuff
import android.graphics.PorterDuffColorFilter import android.graphics.PorterDuffColorFilter
@@ -436,24 +435,30 @@ private fun LottieAnimationView.addOverlayDynamicColor(
fun update() { fun update() {
val isKeyguard = reason == REASON_AUTH_KEYGUARD val isKeyguard = reason == REASON_AUTH_KEYGUARD
if (isKeyguard) { if (isKeyguard) {
val color = context.getColor(R.color.numpad_key_color_secondary) // match bouncer color val color =
com.android.settingslib.Utils.getColorAttrDefaultColor(
context,
com.android.internal.R.attr.materialColorPrimaryFixed
)
val outerRimColor =
com.android.settingslib.Utils.getColorAttrDefaultColor(
context,
com.android.internal.R.attr.materialColorPrimaryFixedDim
)
val chevronFill = val chevronFill =
com.android.settingslib.Utils.getColorAttrDefaultColor( com.android.settingslib.Utils.getColorAttrDefaultColor(
context, context,
android.R.attr.textColorPrimaryInverse com.android.internal.R.attr.materialColorOnPrimaryFixed
) )
for (key in listOf(".blue600", ".blue400")) { addValueCallback(KeyPath(".blue600", "**"), LottieProperty.COLOR_FILTER) {
addValueCallback(KeyPath(key, "**"), LottieProperty.COLOR_FILTER) { PorterDuffColorFilter(color, PorterDuff.Mode.SRC_ATOP)
PorterDuffColorFilter(color, PorterDuff.Mode.SRC_ATOP) }
} addValueCallback(KeyPath(".blue400", "**"), LottieProperty.COLOR_FILTER) {
PorterDuffColorFilter(outerRimColor, PorterDuff.Mode.SRC_ATOP)
} }
addValueCallback(KeyPath(".black", "**"), LottieProperty.COLOR_FILTER) { addValueCallback(KeyPath(".black", "**"), LottieProperty.COLOR_FILTER) {
PorterDuffColorFilter(chevronFill, PorterDuff.Mode.SRC_ATOP) PorterDuffColorFilter(chevronFill, PorterDuff.Mode.SRC_ATOP)
} }
} else if (!isDarkMode(context)) {
addValueCallback(KeyPath(".black", "**"), LottieProperty.COLOR_FILTER) {
PorterDuffColorFilter(Color.WHITE, PorterDuff.Mode.SRC_ATOP)
}
} else if (isDarkMode(context)) { } else if (isDarkMode(context)) {
for (key in listOf(".blue600", ".blue400")) { for (key in listOf(".blue600", ".blue400")) {
addValueCallback(KeyPath(key, "**"), LottieProperty.COLOR_FILTER) { addValueCallback(KeyPath(key, "**"), LottieProperty.COLOR_FILTER) {

View File

@@ -176,9 +176,9 @@ public class UdfpsKeyguardViewLegacy extends UdfpsAnimationView {
} }
mTextColorPrimary = Utils.getColorAttrDefaultColor(mContext, mTextColorPrimary = Utils.getColorAttrDefaultColor(mContext,
android.R.attr.textColorPrimary); com.android.internal.R.attr.materialColorOnSurface);
final int backgroundColor = Utils.getColorAttrDefaultColor(getContext(), final int backgroundColor = Utils.getColorAttrDefaultColor(getContext(),
com.android.internal.R.attr.colorSurface); com.android.internal.R.attr.materialColorSurfaceContainerHigh);
mBgProtection.setImageTintList(ColorStateList.valueOf(backgroundColor)); mBgProtection.setImageTintList(ColorStateList.valueOf(backgroundColor));
mLockScreenFp.invalidate(); // updated with a valueCallback mLockScreenFp.invalidate(); // updated with a valueCallback
} }