Fix the Fingerprint enrollment page's title text creates a truncate

problem when it needs three lines on the R4 device

Add padding between title and lottie animation, and adjust UDFPS
enroll view top margin.

Bug: 269437675

Test: manually test,
1.Go to Go to Settings > Security > Fingerprint Unlock >
Set up Fingerprint Unlock > How to set up your fingerprint >
Touch & hold the fingerprint sensor ,
then to start enroll fingerprint.

2. Always keep the finger in the same position,
then let the title become a three line description
“Change the position of your fingerprint slightly each time”.

3. Check the UI if it has been fixed.

Test: make RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings
.biometrics.fingerprint.FingerprintEnrollEnrollingTest"

Change-Id: Ib330e9fbe01b959892f2f9007ce35f5ab107e42e
This commit is contained in:
Jason Chang
2023-02-17 12:48:00 +00:00
parent 87dca7b54e
commit 848973d300
3 changed files with 94 additions and 0 deletions

View File

@@ -63,6 +63,7 @@ import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
@@ -328,6 +329,23 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
final ViewGroup.LayoutParams containerLp =
portraitLayoutContainer.getLayoutParams();
containerLp.height = 0;
// In the portrait mode, the title and lottie animation view may
// overlap when title needs three lines, so adding some paddings
// between them, and adjusting the fp progress view here accordingly.
final int layoutLottieAnimationPadding = (int) getResources()
.getDimension(R.dimen.udfps_lottie_padding_top);
portraitLayoutContainer.setPadding(0,
layoutLottieAnimationPadding, 0, 0);
final ImageView progressView = udfpsEnrollView.findViewById(
R.id.udfps_enroll_animation_fp_progress_view);
progressView.setPadding(0, -(layoutLottieAnimationPadding),
0, layoutLottieAnimationPadding);
final ImageView fingerprintView = udfpsEnrollView.findViewById(
R.id.udfps_enroll_animation_fp_view);
fingerprintView.setPadding(0, -layoutLottieAnimationPadding,
0, layoutLottieAnimationPadding);
portraitLayoutContainer.addView(udfpsEnrollView);
setOnHoverListener(false, defaultLayout, udfpsEnrollView);
} else if (rotation == Surface.ROTATION_270) {