Merge "Updated fp enrollment to have 5 enroll stages." into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
5b8d645a99
0
res/raw/udfps_right_edge_hint_lottie.json
Normal file
0
res/raw/udfps_right_edge_hint_lottie.json
Normal file
@@ -81,9 +81,11 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
|||||||
private static final int STAGE_CENTER = 0;
|
private static final int STAGE_CENTER = 0;
|
||||||
private static final int STAGE_GUIDED = 1;
|
private static final int STAGE_GUIDED = 1;
|
||||||
private static final int STAGE_FINGERTIP = 2;
|
private static final int STAGE_FINGERTIP = 2;
|
||||||
private static final int STAGE_EDGES = 3;
|
private static final int STAGE_LEFT_EDGE = 3;
|
||||||
|
private static final int STAGE_RIGHT_EDGE = 4;
|
||||||
|
|
||||||
@IntDef({STAGE_UNKNOWN, STAGE_CENTER, STAGE_GUIDED, STAGE_FINGERTIP, STAGE_EDGES})
|
@IntDef({STAGE_UNKNOWN, STAGE_CENTER, STAGE_GUIDED, STAGE_FINGERTIP, STAGE_LEFT_EDGE,
|
||||||
|
STAGE_RIGHT_EDGE})
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
private @interface EnrollStage {}
|
private @interface EnrollStage {}
|
||||||
|
|
||||||
@@ -132,7 +134,8 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
|||||||
private boolean mIsAccessibilityEnabled;
|
private boolean mIsAccessibilityEnabled;
|
||||||
private LottieAnimationView mIllustrationLottie;
|
private LottieAnimationView mIllustrationLottie;
|
||||||
private boolean mHaveShownUdfpsTipLottie;
|
private boolean mHaveShownUdfpsTipLottie;
|
||||||
private boolean mHaveShownUdfpsSideLottie;
|
private boolean mHaveShownUdfpsLeftEdgeLottie;
|
||||||
|
private boolean mHaveShownUdfpsRightEdgeLottie;
|
||||||
private boolean mShouldShowLottie;
|
private boolean mShouldShowLottie;
|
||||||
|
|
||||||
private OrientationEventListener mOrientationEventListener;
|
private OrientationEventListener mOrientationEventListener;
|
||||||
@@ -372,12 +375,31 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STAGE_EDGES:
|
case STAGE_LEFT_EDGE:
|
||||||
setHeaderText(R.string.security_settings_udfps_enroll_edge_title);
|
setHeaderText(R.string.security_settings_udfps_enroll_edge_title);
|
||||||
if (!mHaveShownUdfpsSideLottie && mIllustrationLottie != null) {
|
if (!mHaveShownUdfpsLeftEdgeLottie && mIllustrationLottie != null) {
|
||||||
mHaveShownUdfpsSideLottie = true;
|
mHaveShownUdfpsLeftEdgeLottie = true;
|
||||||
setDescriptionText("");
|
setDescriptionText("");
|
||||||
mIllustrationLottie.setAnimation(R.raw.udfps_edge_hint_lottie);
|
mIllustrationLottie.setAnimation(R.raw.udfps_left_edge_hint_lottie);
|
||||||
|
mIllustrationLottie.setVisibility(View.VISIBLE);
|
||||||
|
mIllustrationLottie.playAnimation();
|
||||||
|
mIllustrationLottie.setContentDescription(
|
||||||
|
getString(R.string.security_settings_udfps_side_fingerprint_help));
|
||||||
|
} else if (mIllustrationLottie == null) {
|
||||||
|
if (isStageHalfCompleted()) {
|
||||||
|
setDescriptionText(
|
||||||
|
R.string.security_settings_fingerprint_enroll_repeat_message);
|
||||||
|
} else {
|
||||||
|
setDescriptionText(R.string.security_settings_udfps_enroll_edge_message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case STAGE_RIGHT_EDGE:
|
||||||
|
setHeaderText(R.string.security_settings_udfps_enroll_edge_title);
|
||||||
|
if (!mHaveShownUdfpsRightEdgeLottie && mIllustrationLottie != null) {
|
||||||
|
mHaveShownUdfpsRightEdgeLottie = true;
|
||||||
|
setDescriptionText("");
|
||||||
|
mIllustrationLottie.setAnimation(R.raw.udfps_right_edge_hint_lottie);
|
||||||
mIllustrationLottie.setVisibility(View.VISIBLE);
|
mIllustrationLottie.setVisibility(View.VISIBLE);
|
||||||
mIllustrationLottie.playAnimation();
|
mIllustrationLottie.playAnimation();
|
||||||
mIllustrationLottie.setContentDescription(
|
mIllustrationLottie.setContentDescription(
|
||||||
@@ -422,8 +444,10 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
|||||||
return STAGE_GUIDED;
|
return STAGE_GUIDED;
|
||||||
} else if (progressSteps < getStageThresholdSteps(2)) {
|
} else if (progressSteps < getStageThresholdSteps(2)) {
|
||||||
return STAGE_FINGERTIP;
|
return STAGE_FINGERTIP;
|
||||||
|
} else if (progressSteps < getStageThresholdSteps(3)) {
|
||||||
|
return STAGE_LEFT_EDGE;
|
||||||
} else {
|
} else {
|
||||||
return STAGE_EDGES;
|
return STAGE_RIGHT_EDGE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user