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

Commit a41c6172 authored by Wenhui Yang's avatar Wenhui Yang Committed by Automerger Merge Worker
Browse files

Merge "Fix overlap in auth_credential_password_view" into udc-dev am: b71e0ae4

parents 58f4b8e3 b71e0ae4
Loading
Loading
Loading
Loading
+35 −28
Original line number Diff line number Diff line
@@ -23,11 +23,15 @@
    android:orientation="vertical"
    android:theme="?app:attr/lockPinPasswordStyle">

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

        <RelativeLayout
            style="?headerStyle"
            android:layout_width="match_parent"
        android:layout_height="match_parent">
            android:layout_height="wrap_content">

            <ImageView
                android:id="@+id/icon"
@@ -39,25 +43,28 @@
            <TextView
                android:id="@+id/title"
                style="?titleTextAppearance"
            android:layout_below="@id/icon"
                android:layout_width="match_parent"
            android:layout_height="wrap_content"/>
                android:layout_height="wrap_content"
                android:layout_below="@id/icon" />

            <TextView
                android:id="@+id/subtitle"
                style="?subTitleTextAppearance"
            android:layout_below="@id/title"
                android:layout_width="match_parent"
            android:layout_height="wrap_content"/>
                android:layout_height="wrap_content"
                android:layout_below="@id/title" />

            <TextView
                android:id="@+id/description"
                style="?descriptionTextAppearance"
            android:layout_below="@id/subtitle"
                android:layout_width="match_parent"
            android:layout_height="wrap_content"/>
                android:layout_height="wrap_content"
                android:layout_below="@id/subtitle" />

        </RelativeLayout>

    </ScrollView>

    <LinearLayout
        android:id="@+id/auth_credential_input"
        android:layout_width="match_parent"
+13 −4
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ class CredentialPasswordView(context: Context, attrs: AttributeSet?) :
        super.onLayout(changed, left, top, right, bottom)

        val inputLeftBound: Int
        val inputTopBound: Int
        var inputTopBound: Int
        var headerRightBound = right
        var headerTopBounds = top
        val subTitleBottom: Int = if (subtitleView.isGone) titleView.bottom else subtitleView.bottom
@@ -75,14 +75,23 @@ class CredentialPasswordView(context: Context, attrs: AttributeSet?) :
            inputLeftBound = (right - left) / 2
            headerRightBound = inputLeftBound
            headerTopBounds -= iconView.bottom.coerceAtMost(bottomInset)

            if (descriptionView.bottom > bottomInset) {
                credentialHeader.layout(left, headerTopBounds, headerRightBound, bottom)
            }
        } else {
            inputTopBound = descBottom + (bottom - descBottom - credentialInput.height) / 2
            inputLeftBound = (right - left - credentialInput.width) / 2

            if (bottom - inputTopBound < credentialInput.height) {
                inputTopBound = bottom - credentialInput.height
            }

        if (descriptionView.bottom > bottomInset) {
            credentialHeader.layout(left, headerTopBounds, headerRightBound, bottom)
            if (descriptionView.bottom > inputTopBound) {
                credentialHeader.layout(left, headerTopBounds, headerRightBound, inputTopBound)
            }
        }

        credentialInput.layout(inputLeftBound, inputTopBound, right, bottom)
    }