Fix the 1st udfps#enroll#error always fill red color

Test: Enable talkback
      Verified animation fades in/out on enrollment error.
Bug: 236801782
Change-Id: I6c9633f54cbf0e208c9ac43d749aec032c1a5ae1
This commit is contained in:
Bill Lin
2022-07-19 16:19:54 +08:00
parent 9ef43b2f6a
commit 84b498d48d

View File

@@ -99,12 +99,11 @@ public class UdfpsEnrollProgressBarDrawable extends Drawable {
mProgressColor = context.getColor(R.color.udfps_enroll_progress);
final AccessibilityManager am = context.getSystemService(AccessibilityManager.class);
mIsAccessibilityEnabled = am.isTouchExplorationEnabled();
mOnFirstBucketFailedColor = context.getColor(R.color.udfps_moving_target_fill_error);
if (!mIsAccessibilityEnabled) {
mHelpColor = context.getColor(R.color.udfps_enroll_progress_help);
mOnFirstBucketFailedColor = context.getColor(R.color.udfps_moving_target_fill_error);
} else {
mHelpColor = context.getColor(R.color.udfps_enroll_progress_help_with_talkback);
mOnFirstBucketFailedColor = mHelpColor;
}
mCheckmarkDrawable = context.getDrawable(R.drawable.udfps_enroll_checkmark);
mCheckmarkDrawable.mutate();
@@ -167,7 +166,8 @@ public class UdfpsEnrollProgressBarDrawable extends Drawable {
}
private void updateProgress(int remainingSteps, int totalSteps, boolean showingHelp) {
if (mRemainingSteps == remainingSteps && mTotalSteps == totalSteps) {
if (mRemainingSteps == remainingSteps && mTotalSteps == totalSteps
&& mShowingHelp == showingHelp) {
return;
}
@@ -197,6 +197,7 @@ public class UdfpsEnrollProgressBarDrawable extends Drawable {
}
}
mShowingHelp = showingHelp;
mRemainingSteps = remainingSteps;
mTotalSteps = totalSteps;