Merge "Fix UDFPS enroll when help received on first step" into sc-v2-dev am: 7f827a230e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16132289 Change-Id: Ic7a0d55dfd419c98f008ba6caa20cca46e6183c6
This commit is contained in:
@@ -40,7 +40,7 @@ public class UdfpsEnrollProgressBarDrawable extends Drawable {
|
|||||||
|
|
||||||
@Nullable private UdfpsEnrollHelper mEnrollHelper;
|
@Nullable private UdfpsEnrollHelper mEnrollHelper;
|
||||||
@NonNull private List<UdfpsEnrollProgressBarSegment> mSegments = new ArrayList<>();
|
@NonNull private List<UdfpsEnrollProgressBarSegment> mSegments = new ArrayList<>();
|
||||||
private int mTotalSteps = 1;
|
private int mTotalSteps = 0;
|
||||||
private int mProgressSteps = 0;
|
private int mProgressSteps = 0;
|
||||||
private boolean mIsShowingHelp = false;
|
private boolean mIsShowingHelp = false;
|
||||||
|
|
||||||
@@ -67,22 +67,19 @@ public class UdfpsEnrollProgressBarDrawable extends Drawable {
|
|||||||
|
|
||||||
void onEnrollmentProgress(int remaining, int totalSteps) {
|
void onEnrollmentProgress(int remaining, int totalSteps) {
|
||||||
mTotalSteps = totalSteps;
|
mTotalSteps = totalSteps;
|
||||||
updateState(getProgressSteps(remaining, totalSteps), false /* isShowingHelp */);
|
|
||||||
|
// Show some progress for the initial touch.
|
||||||
|
updateState(Math.max(1, totalSteps - remaining), false /* isShowingHelp */);
|
||||||
}
|
}
|
||||||
|
|
||||||
void onEnrollmentHelp(int remaining, int totalSteps) {
|
void onEnrollmentHelp(int remaining, int totalSteps) {
|
||||||
updateState(getProgressSteps(remaining, totalSteps), true /* isShowingHelp */);
|
updateState(Math.max(0, totalSteps - remaining), true /* isShowingHelp */);
|
||||||
}
|
}
|
||||||
|
|
||||||
void onLastStepAcquired() {
|
void onLastStepAcquired() {
|
||||||
updateState(mTotalSteps, false /* isShowingHelp */);
|
updateState(mTotalSteps, false /* isShowingHelp */);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int getProgressSteps(int remaining, int totalSteps) {
|
|
||||||
// Show some progress for the initial touch.
|
|
||||||
return Math.max(1, totalSteps - remaining);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateState(int progressSteps, boolean isShowingHelp) {
|
private void updateState(int progressSteps, boolean isShowingHelp) {
|
||||||
updateProgress(progressSteps);
|
updateProgress(progressSteps);
|
||||||
updateFillColor(isShowingHelp);
|
updateFillColor(isShowingHelp);
|
||||||
|
|||||||
Reference in New Issue
Block a user