Fix 4462497: Make lockscreen preference screen layouts more dynamic

This reduces the dependency of LockScreen preference screens
on a particular device size by using centering logic instead of
absolute offsets/sizes.

Change-Id: I6ff9e71dc122e12493148437dda647820ae0f308
diff --git a/res/layout-sw600dp-land/confirm_lock_pattern.xml b/res/layout-sw600dp-land/confirm_lock_pattern.xml
index 04c3e85..ad08e44 100644
--- a/res/layout-sw600dp-land/confirm_lock_pattern.xml
+++ b/res/layout-sw600dp-land/confirm_lock_pattern.xml
@@ -13,48 +13,78 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-
 <com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient
-        xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/topLayout"
     android:orientation="horizontal"
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
+    <!-- left side: lock pattern widget -->
     <RelativeLayout
         android:layout_width="0dip"
         android:layout_height="match_parent"
-        android:layout_weight="1">
+        android:layout_weight="1"
+        android:gravity="center_horizontal|center_vertical"
+        android:orientation="horizontal">
 
-        <!-- left side: lock pattern -->
         <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
              android:layout_width="354dip"
              android:layout_height="354dip"
-             android:layout_gravity="center_horizontal"
-             android:layout_marginTop="72dip"
-             android:layout_marginLeft="111dip"
              aspect="square"/>
 
-        <!-- right side: instructions and buttons -->
-        <!-- header message -->
-        <TextView android:id="@+id/headerText"
-            android:layout_width="542dip"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="88dip"
-            android:layout_alignParentTop="true"
-            android:layout_toRightOf="@id/lockPattern"
-            android:layout_marginLeft="100dip"
-            android:textSize="22sp"/>
+     </RelativeLayout>
+
+    <!-- right side: instructions and buttons -->
+    <RelativeLayout
+        android:layout_width="0dip"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:gravity="center_horizontal">
+
+        <!-- confirm / restart buttons -->
+        <LinearLayout android:id="@+id/buttonContainer"
+            style="@style/SecurityPreferenceButtonContainer"
+            android:layout_alignParentRight="true"
+            android:layout_alignParentBottom="true"
+            android:orientation="horizontal">
+
+            <!-- left / top button: skip, or re-try -->
+            <Button android:id="@+id/footerLeftButton"
+                style="@style/SecurityPreferenceButton"
+                android:text="@string/lockpattern_restart_button_text"/>
+
+            <!-- right / bottom button: confirm or ok -->
+            <Button android:id="@+id/footerRightButton"
+                style="@style/SecurityPreferenceButton"
+                android:text="@string/lockpattern_confirm_button_text"/>
+
+        </LinearLayout>
 
         <!-- footer message -->
         <TextView android:id="@+id/footerText"
-            android:layout_width="542dip"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_below="@id/headerText"
+            android:layout_above="@id/buttonContainer"
             android:layout_marginTop="16dip"
-            android:layout_toRightOf="@id/lockPattern"
-            android:layout_marginLeft="100dip"
-            android:textSize="22sp"/>
+            android:textAppearance="?android:attr/textAppearanceLarge"/>
+
+        <!-- header message -->
+        <ScrollView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_alignParentTop="true"
+            android:layout_marginTop="20dip"
+            android:layout_marginLeft="20dip"
+            android:layout_above="@id/footerText"
+            android:gravity="center_vertical|center_horizontal">
+
+            <TextView android:id="@+id/headerText"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:textSize="22sp"/>
+
+        </ScrollView>
 
     </RelativeLayout>