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

Commit 3c8e52c4 authored by Beverly Tai's avatar Beverly Tai Committed by Automerger Merge Worker
Browse files

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

Merge "Update keyguard fingerprint & face scanning colors" into udc-dev am: b50b3f41 am: 0fd1cd36

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23114258



Change-Id: I3c081ffa69af964da0cd1570e034a1459b3e2954
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents db507c99 0fd1cd36
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 Original line Diff line number Diff line
@@ -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
+16 −11
Original line number Original line Diff line number Diff line
@@ -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) {
+2 −2
Original line number Original line Diff line number Diff line
@@ -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
    }
    }