Fix overlap in auth_credential_password_view
Add a scrollview to match the figma design and fix the logic of view bounds. Fixes: 273588738 Test: Manual (see bug) Change-Id: I0e7452c1bb74e75c4dbb19135dc3c6b8c4b5f7aa
This commit is contained in:
@@ -23,40 +23,47 @@
|
||||
android:orientation="vertical"
|
||||
android:theme="?app:attr/lockPinPasswordStyle">
|
||||
|
||||
<RelativeLayout
|
||||
<ScrollView
|
||||
android:id="@+id/auth_credential_header"
|
||||
style="?headerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
style="?headerIconStyle"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:contentDescription="@null"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
style="?titleTextAppearance"
|
||||
android:layout_below="@id/icon"
|
||||
<RelativeLayout
|
||||
style="?headerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subtitle"
|
||||
style="?subTitleTextAppearance"
|
||||
android:layout_below="@id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
style="?headerIconStyle"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:contentDescription="@null" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
style="?descriptionTextAppearance"
|
||||
android:layout_below="@id/subtitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
style="?titleTextAppearance"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subtitle"
|
||||
style="?subTitleTextAppearance"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
style="?descriptionTextAppearance"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/subtitle" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/auth_credential_input"
|
||||
|
||||
@@ -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 > inputTopBound) {
|
||||
credentialHeader.layout(left, headerTopBounds, headerRightBound, inputTopBound)
|
||||
}
|
||||
}
|
||||
|
||||
if (descriptionView.bottom > bottomInset) {
|
||||
credentialHeader.layout(left, headerTopBounds, headerRightBound, bottom)
|
||||
}
|
||||
credentialInput.layout(inputLeftBound, inputTopBound, right, bottom)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user