Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d26d4b3b authored by lbill's avatar lbill
Browse files

Fix Auth Credential PIN layout inconsistence layout in landscape

The layout of AuthCredentialPasswordView in landscape doesn't consist
with layout in portrait.

This change do:
1. Make layout consistence on both portrait & landscape
2. Hook IME insets change callback and refine layout size
3. Optomize layout complexity

Test: atest SystemUITests
Test: Update Display/Font size to largest, and trigger BioMetric prompt
Bug: 230698721
Merged-In: If484225a9b75af42bc4fee4d288c67c7361a1c89
Change-Id: If484225a9b75af42bc4fee4d288c67c7361a1c89
parent 6ec02000
Loading
Loading
Loading
Loading
+59 −33
Original line number Diff line number Diff line
@@ -18,44 +18,70 @@
    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:orientation="horizontal"
    android:elevation="@dimen/biometric_dialog_elevation">

    <RelativeLayout
        android:id="@+id/auth_credential_header"
        style="@style/AuthCredentialHeaderStyle"
        android:layout_width="wrap_content"
        android:layout_height="match_parent">

        <ImageView
            android:id="@+id/icon"
            style="@style/TextAppearance.AuthNonBioCredential.Icon"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:contentDescription="@null"/>

        <TextView
            android:id="@+id/title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/TextAppearance.AuthCredential.Title"/>
            style="@style/TextAppearance.AuthNonBioCredential.Title"
            android:layout_below="@id/icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

        <TextView
            android:id="@+id/subtitle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/TextAppearance.AuthCredential.Subtitle"/>
            style="@style/TextAppearance.AuthNonBioCredential.Subtitle"
            android:layout_below="@id/title"
            android:layout_alignParentLeft="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

        <TextView
            android:id="@+id/description"
        android:layout_width="match_parent"
            style="@style/TextAppearance.AuthNonBioCredential.Description"
            android:layout_below="@id/subtitle"
            android:layout_alignParentLeft="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

    </RelativeLayout>

    <LinearLayout
        android:id="@+id/auth_credential_input"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        style="@style/TextAppearance.AuthCredential.Description"/>
        android:orientation="vertical">

        <ImeAwareEditText
            android:id="@+id/lockPassword"
            style="@style/TextAppearance.AuthCredential.PasswordEntry"
            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:layout_gravity="center"
            android:imeOptions="actionNext|flagNoFullscreen|flagForceAscii"
        style="@style/TextAppearance.AuthCredential.PasswordEntry"/>
            android:inputType="textPassword"
            android:minHeight="48dp" />

        <TextView
            android:id="@+id/error"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/TextAppearance.AuthCredential.Error"/>
            style="@style/TextAppearance.AuthNonBioCredential.Error"
            android:layout_gravity="center"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

    </LinearLayout>

</com.android.systemui.biometrics.AuthCredentialPasswordView>
 No newline at end of file
+48 −53
Original line number Diff line number Diff line
@@ -22,56 +22,52 @@
    android:orientation="vertical">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <LinearLayout
        android:id="@+id/auth_credential_header"
        style="@style/AuthCredentialHeaderStyle"
        android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true">
        android:layout_height="match_parent">

        <ImageView
            android:id="@+id/icon"
                android:layout_width="48dp"
                android:layout_height="48dp"
            style="@style/TextAppearance.AuthNonBioCredential.Icon"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:contentDescription="@null"/>

        <TextView
            android:id="@+id/title"
            style="@style/TextAppearance.AuthNonBioCredential.Title"
            android:layout_below="@id/icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

        <TextView
            android:id="@+id/subtitle"
            style="@style/TextAppearance.AuthNonBioCredential.Subtitle"
            android:layout_below="@id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

        <TextView
            android:id="@+id/description"
            style="@style/TextAppearance.AuthNonBioCredential.Description"
            android:layout_below="@id/subtitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

        </LinearLayout>
    </RelativeLayout>

    <LinearLayout
        android:id="@+id/auth_credential_input"
        android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center"
            android:orientation="vertical"
            android:layout_alignParentBottom="true">
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <ImeAwareEditText
            android:id="@+id/lockPassword"
            style="@style/TextAppearance.AuthCredential.PasswordEntry"
            android:layout_width="208dp"
            android:layout_height="wrap_content"
                android:layout_gravity="center"
            android:layout_gravity="center_horizontal"
            android:imeOptions="actionNext|flagNoFullscreen|flagForceAscii"
            android:inputType="textPassword"
            android:minHeight="48dp" />
@@ -79,11 +75,10 @@
        <TextView
            android:id="@+id/error"
            style="@style/TextAppearance.AuthNonBioCredential.Error"
            android:layout_gravity="center_horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

    </LinearLayout>

    </RelativeLayout>

</com.android.systemui.biometrics.AuthCredentialPasswordView>
 No newline at end of file
+9 −0
Original line number Diff line number Diff line
@@ -18,4 +18,13 @@
    <style name="BrightnessDialogContainer" parent="@style/BaseBrightnessDialogContainer">
        <item name="android:layout_width">360dp</item>
    </style>

    <style name="AuthCredentialHeaderStyle">
        <item name="android:paddingStart">48dp</item>
        <item name="android:paddingEnd">24dp</item>
        <item name="android:paddingTop">48dp</item>
        <item name="android:paddingBottom">10dp</item>
        <item name="android:gravity">top|center_horizontal</item>
    </style>

</resources>
+3 −0
Original line number Diff line number Diff line
@@ -949,6 +949,9 @@
    <dimen name="biometric_dialog_width">240dp</dimen>
    <dimen name="biometric_dialog_height">240dp</dimen>

    <!-- Biometric Auth Credential values -->
    <dimen name="biometric_auth_icon_size">48dp</dimen>

    <!-- Starting text size in sp of batteryLevel for wireless charging animation -->
    <item name="wireless_charging_anim_battery_level_text_size_start" format="float" type="dimen">
        0
+7 −1
Original line number Diff line number Diff line
@@ -198,6 +198,11 @@
        <item name="android:textColor">?android:attr/textColorPrimary</item>
    </style>

    <style name="TextAppearance.AuthNonBioCredential.Icon">
        <item name="android:layout_width">@dimen/biometric_auth_icon_size</item>
        <item name="android:layout_height">@dimen/biometric_auth_icon_size</item>
    </style>

    <style name="TextAppearance.AuthNonBioCredential.Title">
        <item name="android:fontFamily">google-sans</item>
        <item name="android:layout_marginTop">20dp</item>
@@ -227,6 +232,7 @@

    <style name="TextAppearance.AuthCredential.PasswordEntry" parent="@android:style/TextAppearance.DeviceDefault">
        <item name="android:gravity">center</item>
        <item name="android:paddingTop">28dp</item>
        <item name="android:singleLine">true</item>
        <item name="android:textColor">?android:attr/colorForeground</item>
        <item name="android:textSize">24sp</item>
@@ -235,7 +241,7 @@

    <style name="AuthCredentialHeaderStyle">
        <item name="android:paddingStart">48dp</item>
        <item name="android:paddingEnd">24dp</item>
        <item name="android:paddingEnd">48dp</item>
        <item name="android:paddingTop">28dp</item>
        <item name="android:paddingBottom">20dp</item>
        <item name="android:orientation">vertical</item>
Loading