Loading packages/SystemUI/res/values-night/colors.xml +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ <color name="biometric_dialog_error">#fff28b82</color> <!-- red 300 --> <!-- 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_blue_500">#5195EA</color> Loading packages/SystemUI/res/values/colors.xml +4 −4 Original line number Diff line number Diff line Loading @@ -134,10 +134,10 @@ <color name="biometric_dialog_error">#ffd93025</color> <!-- red 600 --> <!-- UDFPS colors --> <color name="udfps_enroll_icon">#000000</color> <!-- 100% black --> <color name="udfps_moving_target_fill">#cc4285f4</color> <!-- 80% blue --> <color name="udfps_enroll_progress">#ff669DF6</color> <!-- blue 400 --> <color name="udfps_enroll_progress_help">#ffEE675C</color> <!-- red 400 --> <color name="udfps_enroll_icon">#7DA7F1</color> <color name="udfps_moving_target_fill">#475670</color> <color name="udfps_enroll_progress">#7DA7F1</color> <color name="udfps_enroll_progress_help">#ffEE675C</color> <!-- Global screenshot actions --> <color name="global_screenshot_button_ripple">#1f000000</color> Loading packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollDrawable.java +4 −25 Original line number Diff line number Diff line Loading @@ -20,9 +20,7 @@ import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.ValueAnimator; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.PointF; import android.graphics.Rect; Loading @@ -30,7 +28,6 @@ import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.os.Handler; import android.os.Looper; import android.util.TypedValue; import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.LinearInterpolator; Loading @@ -38,7 +35,6 @@ import androidx.annotation.ColorInt; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.internal.graphics.ColorUtils; import com.android.systemui.R; /** Loading Loading @@ -106,9 +102,8 @@ public class UdfpsEnrollDrawable extends UdfpsDrawable { mSensorOutlinePaint = new Paint(0 /* flags */); mSensorOutlinePaint.setAntiAlias(true); mSensorOutlinePaint.setColor(mContext.getColor(R.color.udfps_enroll_icon)); mSensorOutlinePaint.setStyle(Paint.Style.STROKE); mSensorOutlinePaint.setStrokeWidth(2.f); mSensorOutlinePaint.setColor(mContext.getColor(R.color.udfps_moving_target_fill)); mSensorOutlinePaint.setStyle(Paint.Style.FILL); mBlueFill = new Paint(0 /* flags */); mBlueFill.setAntiAlias(true); Loading @@ -117,12 +112,12 @@ public class UdfpsEnrollDrawable extends UdfpsDrawable { mMovingTargetFpIcon = context.getResources() .getDrawable(R.drawable.ic_kg_fingerprint, null); mMovingTargetFpIcon.setTint(Color.WHITE); mMovingTargetFpIcon.setTint(mContext.getColor(R.color.udfps_enroll_icon)); mMovingTargetFpIcon.mutate(); 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); mHintMaxWidthPx = Utils.dpToPixels(context, HINT_MAX_WIDTH_DP); mHintPaddingPx = Utils.dpToPixels(context, HINT_PADDING_DP); Loading Loading @@ -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) { mEnrollHelper = helper; } Loading packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollProgressBarDrawable.java +1 −16 Original line number Diff line number Diff line Loading @@ -18,12 +18,10 @@ package com.android.systemui.biometrics; import android.animation.ValueAnimator; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Paint; import android.graphics.drawable.Drawable; import android.util.TypedValue; import android.view.animation.Interpolator; import android.view.animation.OvershootInterpolator; Loading Loading @@ -80,24 +78,11 @@ public class UdfpsEnrollProgressBarDrawable extends Drawable { mBackgroundPaint = new Paint(); 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.setStyle(Paint.Style.STROKE); 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. mFillPaint = new Paint(); mFillPaint.setStrokeWidth(mStrokeWidthPx); Loading Loading
packages/SystemUI/res/values-night/colors.xml +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ <color name="biometric_dialog_error">#fff28b82</color> <!-- red 300 --> <!-- 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_blue_500">#5195EA</color> Loading
packages/SystemUI/res/values/colors.xml +4 −4 Original line number Diff line number Diff line Loading @@ -134,10 +134,10 @@ <color name="biometric_dialog_error">#ffd93025</color> <!-- red 600 --> <!-- UDFPS colors --> <color name="udfps_enroll_icon">#000000</color> <!-- 100% black --> <color name="udfps_moving_target_fill">#cc4285f4</color> <!-- 80% blue --> <color name="udfps_enroll_progress">#ff669DF6</color> <!-- blue 400 --> <color name="udfps_enroll_progress_help">#ffEE675C</color> <!-- red 400 --> <color name="udfps_enroll_icon">#7DA7F1</color> <color name="udfps_moving_target_fill">#475670</color> <color name="udfps_enroll_progress">#7DA7F1</color> <color name="udfps_enroll_progress_help">#ffEE675C</color> <!-- Global screenshot actions --> <color name="global_screenshot_button_ripple">#1f000000</color> Loading
packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollDrawable.java +4 −25 Original line number Diff line number Diff line Loading @@ -20,9 +20,7 @@ import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.ValueAnimator; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.PointF; import android.graphics.Rect; Loading @@ -30,7 +28,6 @@ import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.os.Handler; import android.os.Looper; import android.util.TypedValue; import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.LinearInterpolator; Loading @@ -38,7 +35,6 @@ import androidx.annotation.ColorInt; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.internal.graphics.ColorUtils; import com.android.systemui.R; /** Loading Loading @@ -106,9 +102,8 @@ public class UdfpsEnrollDrawable extends UdfpsDrawable { mSensorOutlinePaint = new Paint(0 /* flags */); mSensorOutlinePaint.setAntiAlias(true); mSensorOutlinePaint.setColor(mContext.getColor(R.color.udfps_enroll_icon)); mSensorOutlinePaint.setStyle(Paint.Style.STROKE); mSensorOutlinePaint.setStrokeWidth(2.f); mSensorOutlinePaint.setColor(mContext.getColor(R.color.udfps_moving_target_fill)); mSensorOutlinePaint.setStyle(Paint.Style.FILL); mBlueFill = new Paint(0 /* flags */); mBlueFill.setAntiAlias(true); Loading @@ -117,12 +112,12 @@ public class UdfpsEnrollDrawable extends UdfpsDrawable { mMovingTargetFpIcon = context.getResources() .getDrawable(R.drawable.ic_kg_fingerprint, null); mMovingTargetFpIcon.setTint(Color.WHITE); mMovingTargetFpIcon.setTint(mContext.getColor(R.color.udfps_enroll_icon)); mMovingTargetFpIcon.mutate(); 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); mHintMaxWidthPx = Utils.dpToPixels(context, HINT_MAX_WIDTH_DP); mHintPaddingPx = Utils.dpToPixels(context, HINT_PADDING_DP); Loading Loading @@ -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) { mEnrollHelper = helper; } Loading
packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollProgressBarDrawable.java +1 −16 Original line number Diff line number Diff line Loading @@ -18,12 +18,10 @@ package com.android.systemui.biometrics; import android.animation.ValueAnimator; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Paint; import android.graphics.drawable.Drawable; import android.util.TypedValue; import android.view.animation.Interpolator; import android.view.animation.OvershootInterpolator; Loading Loading @@ -80,24 +78,11 @@ public class UdfpsEnrollProgressBarDrawable extends Drawable { mBackgroundPaint = new Paint(); 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.setStyle(Paint.Style.STROKE); 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. mFillPaint = new Paint(); mFillPaint.setStrokeWidth(mStrokeWidthPx); Loading