Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b50b3f41 authored by Beverly Tai's avatar Beverly Tai Committed by Android (Google) Code Review
Browse files

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

parents 766f7509 255e2f0a
Loading
Loading
Loading
Loading
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Original line number Diff line number Diff line
@@ -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
+16 −11
Original line number Diff line number Diff line
@@ -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) {
            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) {
+2 −2
Original line number Diff line number Diff line
@@ -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
    }