From f53ec27a0b95a03cc3883a0267b68cd4ddfbab7d Mon Sep 17 00:00:00 2001 From: Vincent Wang Date: Wed, 13 Apr 2022 21:58:49 +0800 Subject: [PATCH] Fix BiometricPrompt can scroll / overflow on long text 1. Make title & subtitle in single line 2. Make prompt dialog can't grow than 3/4 display height 3. Make description view scrollable BUG: 226643887 Test: 1. Download test app from bug 226643887 2. Check prompt ui Change-Id: Ib95d090729b1561a70a853b17a4e17cdcbb71fbd --- .../res/layout/auth_biometric_contents.xml | 8 ++++++- .../biometrics/AuthBiometricView.java | 7 +++++++ .../biometrics/UdfpsDialogMeasureAdapter.java | 21 +++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/res/layout/auth_biometric_contents.xml b/packages/SystemUI/res/layout/auth_biometric_contents.xml index 58adb9146bd04..e1b294f2d757b 100644 --- a/packages/SystemUI/res/layout/auth_biometric_contents.xml +++ b/packages/SystemUI/res/layout/auth_biometric_contents.xml @@ -21,6 +21,9 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="@integer/biometric_dialog_text_gravity" + android:singleLine="true" + android:marqueeRepeatLimit="1" + android:ellipsize="marquee" style="@style/TextAppearance.AuthCredential.Title"/> limit) { + description.measure( + MeasureSpec.makeMeasureSpec(currWidth, MeasureSpec.EXACTLY), + MeasureSpec.makeMeasureSpec(limit - currHeight, MeasureSpec.EXACTLY)); + } + return description.getMeasuredHeight(); + } + @NonNull private AuthDialog.LayoutParams onMeasureInternalLandscape(int width, int height) { final WindowMetrics windowMetrics = mWindowManager.getMaximumWindowMetrics();