Use layout weight attr and scrollview in lock pattern screen.

General idea is to stop UI distortion when display size set to
largest. Use layout weight to distribute space by ratio, and use
scroll view to wrap "title and summary" layout in case display
size are too large to display.

Bug: 32057149
Test: Visual

Change-Id: Ie800e4c5e98f6bbd699395168cfc228f8b65ac7f
This commit is contained in:
jackqdyulei
2016-10-18 16:39:02 -07:00
parent c33b78df9c
commit 4a1f8a76f3

View File

@@ -29,6 +29,16 @@
android:layout_gravity="top|center_horizontal"
android:paddingTop="@dimen/confirm_credentials_top_padding">
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
style="@android:style/TextAppearance.Material.Headline"
android:id="@+id/headerText"
@@ -46,8 +56,7 @@
android:layout_marginEnd="?attr/confirmDeviceCredentialsSideMargin"
android:layout_marginTop="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
android:layout_height="wrap_content"/>
<Button
style="@android:style/Widget.Material.Button.Borderless"
@@ -58,18 +67,16 @@
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"/>
</LinearLayout>
<View android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.5"/>
</ScrollView>
<com.android.internal.widget.LockPatternView
android:id="@+id/lockPattern"
android:layout_width="312dp"
android:layout_height="312dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="-46dp"
android:layout_marginBottom="-46dp"/>
android:layout_height="0dp"
android:layout_weight="3"
android:layout_gravity="center_horizontal"/>
<LinearLayout
android:layout_width="match_parent"