Make BiometricPrompt credential UI closer to Settings
Adjusts the fonts, sizes, and positions of the AuthCredentialView UI
invoked by BiometricPrompt to better match the UI for setting or
confirming a PIN/pattern/password in Settings.
Test: Manually, using the BiometricPrompt demo and TestDPC apps
Fixes: 152053691
Change-Id: I0d0316b2ac5bde696706e916a29021481e824509
diff --git a/packages/SystemUI/res/layout-land/auth_credential_pattern_view.xml b/packages/SystemUI/res/layout-land/auth_credential_pattern_view.xml
index e791c8a..19a85fe 100644
--- a/packages/SystemUI/res/layout-land/auth_credential_pattern_view.xml
+++ b/packages/SystemUI/res/layout-land/auth_credential_pattern_view.xml
@@ -48,11 +48,7 @@
android:id="@+id/subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginHorizontal="24dp"
- android:layout_marginTop="8dp"
- android:textSize="16sp"
- android:gravity="center"
- android:textColor="?android:attr/textColorPrimary"/>
+ style="@style/TextAppearance.AuthCredential.Subtitle"/>
<TextView
android:id="@+id/description"
@@ -69,10 +65,7 @@
android:id="@+id/error"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginHorizontal="24dp"
- android:textSize="16sp"
- android:gravity="center"
- android:textColor="?android:attr/colorError"/>
+ style="@style/TextAppearance.AuthCredential.Error"/>
<Space
android:layout_width="0dp"
diff --git a/packages/SystemUI/res/layout/auth_biometric_contents.xml b/packages/SystemUI/res/layout/auth_biometric_contents.xml
index a1006a8..6b61046 100644
--- a/packages/SystemUI/res/layout/auth_biometric_contents.xml
+++ b/packages/SystemUI/res/layout/auth_biometric_contents.xml
@@ -18,34 +18,24 @@
<TextView
android:id="@+id/title"
- android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingHorizontal="24dp"
- android:paddingTop="24dp"
android:gravity="@integer/biometric_dialog_text_gravity"
- android:textSize="20sp"
- android:textColor="?android:attr/textColorPrimary"/>
+ style="@style/TextAppearance.AuthCredential.Title"/>
<TextView
android:id="@+id/subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingTop="8dp"
- android:paddingHorizontal="24dp"
android:gravity="@integer/biometric_dialog_text_gravity"
- android:textSize="16sp"
- android:textColor="?android:attr/textColorPrimary"/>
+ style="@style/TextAppearance.AuthCredential.Subtitle"/>
<TextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingHorizontal="24dp"
- android:paddingTop="8dp"
android:gravity="@integer/biometric_dialog_text_gravity"
- android:textSize="16sp"
- android:textColor="?android:attr/textColorPrimary"/>
+ style="@style/TextAppearance.AuthCredential.Description"/>
<ImageView
android:id="@+id/biometric_icon"
diff --git a/packages/SystemUI/res/layout/auth_credential_password_view.xml b/packages/SystemUI/res/layout/auth_credential_password_view.xml
index b14bc7d..45638ce 100644
--- a/packages/SystemUI/res/layout/auth_credential_password_view.xml
+++ b/packages/SystemUI/res/layout/auth_credential_password_view.xml
@@ -42,11 +42,7 @@
android:id="@+id/subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginHorizontal="24dp"
- android:layout_marginTop="8dp"
- android:textSize="16sp"
- android:gravity="center"
- android:textColor="?android:attr/textColorPrimary"/>
+ style="@style/TextAppearance.AuthCredential.Subtitle"/>
<TextView
android:id="@+id/description"
@@ -59,15 +55,6 @@
android:layout_height="0dp"
android:layout_weight="1"/>
- <TextView
- android:id="@+id/error"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginHorizontal="24dp"
- android:textSize="16sp"
- android:gravity="center"
- android:textColor="?android:attr/colorError"/>
-
<EditText
android:id="@+id/lockPassword"
android:layout_width="208dp"
@@ -80,6 +67,12 @@
android:imeOptions="actionNext|flagNoFullscreen|flagForceAscii"
style="@style/TextAppearance.AuthCredential.PasswordEntry"/>
+ <TextView
+ android:id="@+id/error"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ style="@style/TextAppearance.AuthCredential.Error"/>
+
<Space
android:layout_width="0dp"
android:layout_height="0dp"
diff --git a/packages/SystemUI/res/layout/auth_credential_pattern_view.xml b/packages/SystemUI/res/layout/auth_credential_pattern_view.xml
index eda5ecb..4939ea2 100644
--- a/packages/SystemUI/res/layout/auth_credential_pattern_view.xml
+++ b/packages/SystemUI/res/layout/auth_credential_pattern_view.xml
@@ -42,11 +42,7 @@
android:id="@+id/subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginHorizontal="24dp"
- android:layout_marginTop="8dp"
- android:textSize="16sp"
- android:gravity="center"
- android:textColor="?android:attr/textColorPrimary"/>
+ style="@style/TextAppearance.AuthCredential.Subtitle"/>
<TextView
android:id="@+id/description"
@@ -89,10 +85,7 @@
android:id="@+id/error"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginHorizontal="24dp"
- android:textSize="16sp"
- android:gravity="center"
- android:textColor="?android:attr/colorError"/>
+ style="@style/TextAppearance.AuthCredential.Error"/>
</LinearLayout>
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index 1233d4d..5e6af8d 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -250,28 +250,39 @@
<style name="TextAppearance.AuthCredential">
<item name="android:gravity">center_horizontal</item>
- <item name="android:fontFamily">google-sans</item>
<item name="android:textAlignment">gravity</item>
<item name="android:layout_gravity">top</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
</style>
<style name="TextAppearance.AuthCredential.Title">
- <item name="android:layout_marginBottom">2dp</item>
- <item name="android:layout_marginLeft">24dp</item>
- <item name="android:layout_marginRight">24dp</item>
- <item name="android:layout_marginTop">16dp</item>
+ <item name="android:fontFamily">google-sans</item>
+ <item name="android:paddingTop">16dp</item>
+ <item name="android:paddingHorizontal">24dp</item>
<item name="android:textSize">24sp</item>
</style>
- <style name="TextAppearance.AuthCredential.Description">
- <item name="android:layout_marginBottom">12dp</item>
- <item name="android:layout_marginStart">40dp</item>
- <item name="android:layout_marginEnd">40dp</item>
- <item name="android:layout_marginTop">3dp</item>
+ <style name="TextAppearance.AuthCredential.Subtitle">
+ <item name="android:fontFamily">google-sans</item>
+ <item name="android:paddingTop">8dp</item>
+ <item name="android:paddingHorizontal">24dp</item>
<item name="android:textSize">16sp</item>
</style>
+ <style name="TextAppearance.AuthCredential.Description">
+ <item name="android:fontFamily">google-sans</item>
+ <item name="android:paddingTop">8dp</item>
+ <item name="android:paddingHorizontal">24dp</item>
+ <item name="android:textSize">14sp</item>
+ </style>
+
+ <style name="TextAppearance.AuthCredential.Error">
+ <item name="android:paddingTop">12dp</item>
+ <item name="android:paddingHorizontal">24dp</item>
+ <item name="android:textSize">14sp</item>
+ <item name="android:textColor">?android:attr/colorError</item>
+ </style>
+
<style name="TextAppearance.AuthCredential.PasswordEntry" parent="@android:style/TextAppearance.DeviceDefault">
<item name="android:gravity">center</item>
<item name="android:singleLine">true</item>