Merge "Updated ufps enrollment colors." into sc-v2-dev am: d182a490e8

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

Change-Id: I6203f5c8005e67192e1552349f3aa1284bc990fe
This commit is contained in:
Joshua Mccloskey
2021-12-10 20:33:45 +00:00
committed by Automerger Merge Worker
4 changed files with 10 additions and 46 deletions

View File

@@ -77,7 +77,7 @@
<color name="biometric_dialog_error">#fff28b82</color> <!-- red 300 --> <color name="biometric_dialog_error">#fff28b82</color> <!-- red 300 -->
<!-- UDFPS colors --> <!-- UDFPS colors -->
<color name="udfps_enroll_icon">#ffffff</color> <!-- 100% white --> <color name="udfps_enroll_icon">#7DA7F1</color>
<color name="GM2_green_500">#FF41Af6A</color> <color name="GM2_green_500">#FF41Af6A</color>
<color name="GM2_blue_500">#5195EA</color> <color name="GM2_blue_500">#5195EA</color>

View File

@@ -134,10 +134,10 @@
<color name="biometric_dialog_error">#ffd93025</color> <!-- red 600 --> <color name="biometric_dialog_error">#ffd93025</color> <!-- red 600 -->
<!-- UDFPS colors --> <!-- UDFPS colors -->
<color name="udfps_enroll_icon">#000000</color> <!-- 100% black --> <color name="udfps_enroll_icon">#7DA7F1</color>
<color name="udfps_moving_target_fill">#cc4285f4</color> <!-- 80% blue --> <color name="udfps_moving_target_fill">#475670</color>
<color name="udfps_enroll_progress">#ff669DF6</color> <!-- blue 400 --> <color name="udfps_enroll_progress">#7DA7F1</color>
<color name="udfps_enroll_progress_help">#ffEE675C</color> <!-- red 400 --> <color name="udfps_enroll_progress_help">#ffEE675C</color>
<!-- Global screenshot actions --> <!-- Global screenshot actions -->
<color name="global_screenshot_button_ripple">#1f000000</color> <color name="global_screenshot_button_ripple">#1f000000</color>

View File

@@ -20,9 +20,7 @@ import android.animation.Animator;
import android.animation.AnimatorSet; import android.animation.AnimatorSet;
import android.animation.ValueAnimator; import android.animation.ValueAnimator;
import android.content.Context; import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint; import android.graphics.Paint;
import android.graphics.PointF; import android.graphics.PointF;
import android.graphics.Rect; import android.graphics.Rect;
@@ -30,7 +28,6 @@ import android.graphics.RectF;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import android.util.TypedValue;
import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.LinearInterpolator; import android.view.animation.LinearInterpolator;
@@ -38,7 +35,6 @@ import androidx.annotation.ColorInt;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.android.internal.graphics.ColorUtils;
import com.android.systemui.R; import com.android.systemui.R;
/** /**
@@ -106,9 +102,8 @@ public class UdfpsEnrollDrawable extends UdfpsDrawable {
mSensorOutlinePaint = new Paint(0 /* flags */); mSensorOutlinePaint = new Paint(0 /* flags */);
mSensorOutlinePaint.setAntiAlias(true); mSensorOutlinePaint.setAntiAlias(true);
mSensorOutlinePaint.setColor(mContext.getColor(R.color.udfps_enroll_icon)); mSensorOutlinePaint.setColor(mContext.getColor(R.color.udfps_moving_target_fill));
mSensorOutlinePaint.setStyle(Paint.Style.STROKE); mSensorOutlinePaint.setStyle(Paint.Style.FILL);
mSensorOutlinePaint.setStrokeWidth(2.f);
mBlueFill = new Paint(0 /* flags */); mBlueFill = new Paint(0 /* flags */);
mBlueFill.setAntiAlias(true); mBlueFill.setAntiAlias(true);
@@ -117,12 +112,12 @@ public class UdfpsEnrollDrawable extends UdfpsDrawable {
mMovingTargetFpIcon = context.getResources() mMovingTargetFpIcon = context.getResources()
.getDrawable(R.drawable.ic_kg_fingerprint, null); .getDrawable(R.drawable.ic_kg_fingerprint, null);
mMovingTargetFpIcon.setTint(Color.WHITE); mMovingTargetFpIcon.setTint(mContext.getColor(R.color.udfps_enroll_icon));
mMovingTargetFpIcon.mutate(); mMovingTargetFpIcon.mutate();
mFingerprintDrawable.setTint(mContext.getColor(R.color.udfps_enroll_icon)); mFingerprintDrawable.setTint(mContext.getColor(R.color.udfps_enroll_icon));
mHintColorFaded = getHintColorFaded(context); mHintColorFaded = context.getColor(R.color.udfps_moving_target_fill);
mHintColorHighlight = context.getColor(R.color.udfps_enroll_progress); mHintColorHighlight = context.getColor(R.color.udfps_enroll_progress);
mHintMaxWidthPx = Utils.dpToPixels(context, HINT_MAX_WIDTH_DP); mHintMaxWidthPx = Utils.dpToPixels(context, HINT_MAX_WIDTH_DP);
mHintPaddingPx = Utils.dpToPixels(context, HINT_PADDING_DP); mHintPaddingPx = Utils.dpToPixels(context, HINT_PADDING_DP);
@@ -218,22 +213,6 @@ public class UdfpsEnrollDrawable extends UdfpsDrawable {
}; };
} }
@ColorInt
private static int getHintColorFaded(@NonNull Context context) {
final TypedValue tv = new TypedValue();
context.getTheme().resolveAttribute(android.R.attr.disabledAlpha, tv, true);
final int alpha = (int) (tv.getFloat() * 255f);
final int[] attrs = new int[] {android.R.attr.colorControlNormal};
final TypedArray ta = context.obtainStyledAttributes(attrs);
try {
@ColorInt final int color = ta.getColor(0, context.getColor(R.color.white_disabled));
return ColorUtils.setAlphaComponent(color, alpha);
} finally {
ta.recycle();
}
}
void setEnrollHelper(@NonNull UdfpsEnrollHelper helper) { void setEnrollHelper(@NonNull UdfpsEnrollHelper helper) {
mEnrollHelper = helper; mEnrollHelper = helper;
} }

View File

@@ -18,12 +18,10 @@ package com.android.systemui.biometrics;
import android.animation.ValueAnimator; import android.animation.ValueAnimator;
import android.content.Context; import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.ColorFilter; import android.graphics.ColorFilter;
import android.graphics.Paint; import android.graphics.Paint;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.util.TypedValue;
import android.view.animation.Interpolator; import android.view.animation.Interpolator;
import android.view.animation.OvershootInterpolator; import android.view.animation.OvershootInterpolator;
@@ -80,24 +78,11 @@ public class UdfpsEnrollProgressBarDrawable extends Drawable {
mBackgroundPaint = new Paint(); mBackgroundPaint = new Paint();
mBackgroundPaint.setStrokeWidth(mStrokeWidthPx); mBackgroundPaint.setStrokeWidth(mStrokeWidthPx);
mBackgroundPaint.setColor(context.getColor(R.color.white_disabled)); mBackgroundPaint.setColor(context.getColor(R.color.udfps_moving_target_fill));
mBackgroundPaint.setAntiAlias(true); mBackgroundPaint.setAntiAlias(true);
mBackgroundPaint.setStyle(Paint.Style.STROKE); mBackgroundPaint.setStyle(Paint.Style.STROKE);
mBackgroundPaint.setStrokeCap(Paint.Cap.ROUND); mBackgroundPaint.setStrokeCap(Paint.Cap.ROUND);
// Set background paint color and alpha.
final int[] attrs = new int[] {android.R.attr.colorControlNormal};
final TypedArray typedArray = context.obtainStyledAttributes(attrs);
try {
@ColorInt final int tintColor = typedArray.getColor(0, mBackgroundPaint.getColor());
mBackgroundPaint.setColor(tintColor);
} finally {
typedArray.recycle();
}
TypedValue alpha = new TypedValue();
context.getTheme().resolveAttribute(android.R.attr.disabledAlpha, alpha, true);
mBackgroundPaint.setAlpha((int) (alpha.getFloat() * 255f));
// Progress fill should *not* use the extracted system color. // Progress fill should *not* use the extracted system color.
mFillPaint = new Paint(); mFillPaint = new Paint();
mFillPaint.setStrokeWidth(mStrokeWidthPx); mFillPaint.setStrokeWidth(mStrokeWidthPx);