Update work challenge to align with material next

Summary:
* Update title, subtitle, description and icon
* Update layout for entering credentials

Follow-up:
* There are still some UI componenets which don't
  fully align with material next. A larger
  change will need to be made to fix this, which
  we will aim to do in Android T.
* This includes the status bar and nav bar appearance
  and the password entry text field.

Pattern:
* Settings (WAI): https://screenshot.googleplex.com/BiQYeWSrkxL6iRW
* Work Challenge (after changes): https://screenshot.googleplex.com/7ThwqMpbHu8yLWg

Password/PIN:
* Settings (WAI): https://screenshot.googleplex.com/9zUMGgYBvyhYdBa
* Work Challenge (after changes): https://screenshot.googleplex.com/46SVNAzkWesyi8M

Bug: 191948779
Test: manual testing using TestDPC
Change-Id: I6cca39d447e37310c287d1a0eb0468565e9fcd37
This commit is contained in:
Alex Johnston
2021-11-10 14:29:53 +00:00
parent 32e6121883
commit 352a3997e1
3 changed files with 150 additions and 126 deletions

View File

@@ -18,64 +18,71 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_horizontal"
android:elevation="@dimen/biometric_dialog_elevation">
android:elevation="@dimen/biometric_dialog_elevation"
android:orientation="vertical">
<Space
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"/>
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/title"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextAppearance.AuthCredential.Title"/>
android:layout_height="match_parent">
<TextView
android:id="@+id/subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextAppearance.AuthCredential.Subtitle"/>
<LinearLayout
android:id="@+id/auth_credential_header"
style="@style/AuthCredentialHeaderStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true">
<TextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextAppearance.AuthCredential.Description"/>
<ImageView
android:id="@+id/icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:contentDescription="@null" />
<Space
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"/>
<TextView
android:id="@+id/title"
style="@style/TextAppearance.AuthCredential.Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImeAwareEditText
android:id="@+id/lockPassword"
android:layout_width="208dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:minHeight="48dp"
android:gravity="center"
android:inputType="textPassword"
android:maxLength="500"
android:imeOptions="actionNext|flagNoFullscreen|flagForceAscii"
style="@style/TextAppearance.AuthCredential.PasswordEntry"/>
<TextView
android:id="@+id/subtitle"
style="@style/TextAppearance.AuthCredential.Subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/error"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextAppearance.AuthCredential.Error"/>
<TextView
android:id="@+id/description"
style="@style/TextAppearance.AuthCredential.Description"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Space
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="5"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:layout_alignParentBottom="true">
<ImeAwareEditText
android:id="@+id/lockPassword"
style="@style/TextAppearance.AuthCredential.PasswordEntry"
android:layout_width="208dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:imeOptions="actionNext|flagNoFullscreen|flagForceAscii"
android:inputType="textPassword"
android:minHeight="48dp" />
<TextView
android:id="@+id/error"
style="@style/TextAppearance.AuthCredential.Error"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</RelativeLayout>
</com.android.systemui.biometrics.AuthCredentialPasswordView>

View File

@@ -22,76 +22,81 @@
android:gravity="center_horizontal"
android:elevation="@dimen/biometric_dialog_elevation">
<Space
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"/>
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/title"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextAppearance.AuthCredential.Title"/>
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextAppearance.AuthCredential.Subtitle"/>
<LinearLayout
android:id="@+id/auth_credential_header"
style="@style/AuthCredentialHeaderStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextAppearance.AuthCredential.Description"/>
<ImageView
android:id="@+id/icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:contentDescription="@null" />
<Space
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"/>
<TextView
android:id="@+id/title"
style="@style/TextAppearance.AuthCredential.Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="0dp"
android:paddingBottom="16dp"
android:clipToPadding="false">
<TextView
android:id="@+id/subtitle"
style="@style/TextAppearance.AuthCredential.Subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
style="@style/LockPatternContainerStyle">
<TextView
android:id="@+id/description"
style="@style/TextAppearance.AuthCredential.Description"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<com.android.internal.widget.LockPatternView
android:id="@+id/lockPattern"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
style="@style/LockPatternStyleBiometricPrompt"/>
</FrameLayout>
<TextView
android:id="@+id/error"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextAppearance.AuthCredential.Error"/>
android:layout_below="@id/auth_credential_header"
android:gravity="center"
android:orientation="vertical"
android:paddingBottom="16dp"
android:paddingTop="60dp">
</LinearLayout>
<FrameLayout
style="@style/LockPatternContainerStyle"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1">
<Space
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"/>
<com.android.internal.widget.LockPatternView
android:id="@+id/lockPattern"
style="@style/LockPatternStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center" />
</FrameLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<TextView
android:id="@+id/error"
style="@style/TextAppearance.AuthCredential.Error"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</RelativeLayout>
</com.android.systemui.biometrics.AuthCredentialPatternView>

View File

@@ -200,9 +200,9 @@
<style name="TextAppearance.DeviceManagementDialog.Title" parent="@android:style/TextAppearance.DeviceDefault.DialogWindowTitle"/>
<style name="TextAppearance.AuthCredential">
<style name="TextAppearance.AuthCredential"
parent="@android:style/TextAppearance.DeviceDefault">
<item name="android:accessibilityLiveRegion">polite</item>
<item name="android:gravity">center_horizontal</item>
<item name="android:textAlignment">gravity</item>
<item name="android:layout_gravity">top</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
@@ -210,44 +210,57 @@
<style name="TextAppearance.AuthCredential.Title">
<item name="android:fontFamily">google-sans</item>
<item name="android:paddingTop">12dp</item>
<item name="android:paddingHorizontal">24dp</item>
<item name="android:textSize">24sp</item>
<item name="android:layout_marginTop">20dp</item>
<item name="android:textSize">36sp</item>
</style>
<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>
<item name="android:layout_marginTop">20dp</item>
<item name="android:textSize">18sp</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>
<item name="android:layout_marginTop">20dp</item>
<item name="android:textSize">16sp</item>
</style>
<style name="TextAppearance.AuthCredential.Error">
<item name="android:paddingTop">6dp</item>
<item name="android:paddingBottom">18dp</item>
<item name="android:paddingHorizontal">24dp</item>
<item name="android:textSize">14sp</item>
<item name="android:textColor">?android:attr/colorError</item>
<item name="android:gravity">center</item>
</style>
<style name="TextAppearance.AuthCredential.PasswordEntry" parent="@android:style/TextAppearance.DeviceDefault">
<style name="TextAppearance.AuthCredential.PasswordEntry">
<item name="android:gravity">center</item>
<item name="android:singleLine">true</item>
<item name="android:textColor">?android:attr/colorForeground</item>
<item name="android:textSize">24sp</item>
</style>
<style name="AuthCredentialHeaderStyle">
<item name="android:paddingStart">48dp</item>
<item name="android:paddingEnd">24dp</item>
<item name="android:paddingTop">28dp</item>
<item name="android:paddingBottom">20dp</item>
<item name="android:orientation">vertical</item>
<item name="android:layout_gravity">top</item>
</style>
<style name="DeviceManagementDialogTitle">
<item name="android:gravity">center</item>
<item name="android:textAppearance">@style/TextAppearance.DeviceManagementDialog.Title</item>
</style>
<style name="AuthCredentialPasswordTheme" parent="@style/Theme.MaterialComponents.DayNight">
<item name="colorPrimary">?android:attr/colorPrimary</item>
<item name="colorPrimaryDark">?android:attr/colorPrimary</item>
</style>
<style name="TextAppearance.DeviceManagementDialog.Content" parent="@*android:style/TextAppearance.DeviceDefault.Subhead"/>
<style name="BaseBrightnessDialogContainer" parent="@style/Theme.SystemUI">
@@ -307,9 +320,8 @@
<item name="android:maxWidth">420dp</item>
<item name="android:minHeight">0dp</item>
<item name="android:minWidth">0dp</item>
<item name="android:paddingBottom">0dp</item>
<item name="android:paddingHorizontal">44dp</item>
<item name="android:paddingTop">0dp</item>
<item name="android:paddingHorizontal">60dp</item>
<item name="android:paddingBottom">40dp</item>
</style>
<style name="LockPatternStyle">