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

View File

@@ -20,7 +20,6 @@ import android.animation.AnimatorListenerAdapter
import android.app.ActivityTaskManager
import android.content.Context
import android.content.res.Configuration
import android.graphics.Color
import android.graphics.PixelFormat
import android.graphics.PorterDuff
import android.graphics.PorterDuffColorFilter
@@ -436,24 +435,30 @@ private fun LottieAnimationView.addOverlayDynamicColor(
fun update() {
val isKeyguard = reason == REASON_AUTH_KEYGUARD
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 =
com.android.settingslib.Utils.getColorAttrDefaultColor(
context,
android.R.attr.textColorPrimaryInverse
com.android.internal.R.attr.materialColorOnPrimaryFixed
)
for (key in listOf(".blue600", ".blue400")) {
addValueCallback(KeyPath(key, "**"), LottieProperty.COLOR_FILTER) {
PorterDuffColorFilter(color, PorterDuff.Mode.SRC_ATOP)
}
addValueCallback(KeyPath(".blue600", "**"), LottieProperty.COLOR_FILTER) {
PorterDuffColorFilter(color, PorterDuff.Mode.SRC_ATOP)
}
addValueCallback(KeyPath(".blue400", "**"), LottieProperty.COLOR_FILTER) {
PorterDuffColorFilter(outerRimColor, PorterDuff.Mode.SRC_ATOP)
}
addValueCallback(KeyPath(".black", "**"), LottieProperty.COLOR_FILTER) {
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)) {
for (key in listOf(".blue600", ".blue400")) {
addValueCallback(KeyPath(key, "**"), LottieProperty.COLOR_FILTER) {

View File

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