Fix 3383575: use styled attribs and update layout

This updates the layout to make more room for the button
text in SecuritySettings. The code now uses styled attributes
to make it easier to tweak in the future.

Change-Id: I5fbdf2f6ae4c4c1f9614ab97891f9f2fe6cda628
diff --git a/res/layout-xlarge-land/choose_lock_password.xml b/res/layout-xlarge-land/choose_lock_password.xml
index 586e7d5..9518672 100644
--- a/res/layout-xlarge-land/choose_lock_password.xml
+++ b/res/layout-xlarge-land/choose_lock_password.xml
@@ -64,26 +64,19 @@
 
     <!-- confirm / restart buttons -->
     <LinearLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
+        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/cancel_button"
-            android:layout_width="140dip"
-            android:layout_height="wrap_content"
-            android:ellipsize="marquee"
-            android:singleLine="true"
+            style="@style/SecurityPreferenceButton"
             android:text="@string/lockpassword_cancel_label"/>
 
         <!-- right / bottom button: confirm or ok -->
         <Button android:id="@+id/next_button"
-            android:layout_width="140dip"
-            android:layout_height="wrap_content"
-            android:ellipsize="marquee"
-            android:singleLine="true"
+            style="@style/SecurityPreferenceButton"
             android:text="@string/lockpassword_continue_label"/>
 
     </LinearLayout>
diff --git a/res/layout-xlarge-land/choose_lock_pattern.xml b/res/layout-xlarge-land/choose_lock_pattern.xml
index e2cbdab..fc5e787 100644
--- a/res/layout-xlarge-land/choose_lock_pattern.xml
+++ b/res/layout-xlarge-land/choose_lock_pattern.xml
@@ -59,26 +59,19 @@
 
         <!-- confirm / restart buttons -->
         <LinearLayout
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            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"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpattern_restart_button_text"/>
 
             <!-- right / bottom button: confirm or ok -->
             <Button android:id="@+id/footerRightButton"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpattern_confirm_button_text"/>
 
         </LinearLayout>
diff --git a/res/layout-xlarge-land/choose_lock_pattern_tutorial.xml b/res/layout-xlarge-land/choose_lock_pattern_tutorial.xml
index 56addbb..32b452d 100644
--- a/res/layout-xlarge-land/choose_lock_pattern_tutorial.xml
+++ b/res/layout-xlarge-land/choose_lock_pattern_tutorial.xml
@@ -48,26 +48,19 @@
             android:textSize="22sp"/>
 
         <LinearLayout
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            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/skip_button"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpattern_tutorial_cancel_label"/>
 
             <!-- right / bottom button: confirm or ok -->
             <Button android:id="@+id/next_button"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpattern_tutorial_continue_label"/>
 
         </LinearLayout>
diff --git a/res/layout-xlarge-land/confirm_lock_password.xml b/res/layout-xlarge-land/confirm_lock_password.xml
index 7ae8944..3874f11 100644
--- a/res/layout-xlarge-land/confirm_lock_password.xml
+++ b/res/layout-xlarge-land/confirm_lock_password.xml
@@ -65,26 +65,19 @@
 
     <!-- confirm / restart buttons -->
     <LinearLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
+        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/cancel_button"
-            android:layout_width="140dip"
-            android:layout_height="wrap_content"
-            android:ellipsize="marquee"
-            android:singleLine="true"
+            style="@style/SecurityPreferenceButton"
             android:text="@string/lockpassword_cancel_label"/>
 
         <!-- right / bottom button: confirm or ok -->
         <Button android:id="@+id/next_button"
-            android:layout_width="140dip"
-            android:layout_height="wrap_content"
-            android:ellipsize="marquee"
-            android:singleLine="true"
+            style="@style/SecurityPreferenceButton"
             android:text="@string/lockpassword_continue_label"/>
 
     </LinearLayout>
diff --git a/res/layout-xlarge/choose_lock_password.xml b/res/layout-xlarge/choose_lock_password.xml
index f923971..c8a0866 100644
--- a/res/layout-xlarge/choose_lock_password.xml
+++ b/res/layout-xlarge/choose_lock_password.xml
@@ -84,23 +84,16 @@
         android:layout_width="match_parent">
 
         <LinearLayout
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            style="@style/SecurityPreferenceButtonContainer"
             android:layout_alignParentRight="true"
             android:orientation="horizontal">
 
             <Button android:id="@+id/cancel_button"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpassword_cancel_label"/>
 
             <Button android:id="@+id/next_button"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpassword_continue_label"/>
 
         </LinearLayout>
diff --git a/res/layout-xlarge/choose_lock_pattern.xml b/res/layout-xlarge/choose_lock_pattern.xml
index 5995c26..6b7b90e 100644
--- a/res/layout-xlarge/choose_lock_pattern.xml
+++ b/res/layout-xlarge/choose_lock_pattern.xml
@@ -54,25 +54,18 @@
         android:layout_height="wrap_content">
 
         <LinearLayout
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            style="@style/SecurityPreferenceButtonContainer"
             android:layout_alignParentRight="true"
             android:orientation="horizontal">
 
             <!-- left / top button: skip, or re-try -->
             <Button android:id="@+id/footerLeftButton"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpattern_restart_button_text"/>
 
             <!-- right / bottom button: confirm or ok -->
             <Button android:id="@+id/footerRightButton"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpattern_confirm_button_text"/>
 
         </LinearLayout>
diff --git a/res/layout-xlarge/choose_lock_pattern_tutorial.xml b/res/layout-xlarge/choose_lock_pattern_tutorial.xml
index ea09727..c7bdc88 100644
--- a/res/layout-xlarge/choose_lock_pattern_tutorial.xml
+++ b/res/layout-xlarge/choose_lock_pattern_tutorial.xml
@@ -47,25 +47,18 @@
         android:layout_height="wrap_content">
 
         <LinearLayout
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            style="@style/SecurityPreferenceButtonContainer"
             android:layout_alignParentRight="true"
             android:orientation="horizontal">
 
             <!-- left / top button: skip, or re-try -->
             <Button android:id="@+id/skip_button"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpattern_tutorial_cancel_label"/>
 
             <!-- right / bottom button: confirm or ok -->
             <Button android:id="@+id/next_button"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpattern_tutorial_continue_label"/>
 
         </LinearLayout>
diff --git a/res/layout-xlarge/confirm_lock_password.xml b/res/layout-xlarge/confirm_lock_password.xml
index abb0d79..5ffc5e7 100644
--- a/res/layout-xlarge/confirm_lock_password.xml
+++ b/res/layout-xlarge/confirm_lock_password.xml
@@ -87,23 +87,16 @@
         android:layout_width="match_parent">
 
         <LinearLayout
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            style="@style/SecurityPreferenceButtonContainer"
             android:layout_alignParentRight="true"
             android:orientation="horizontal">
 
             <Button android:id="@+id/cancel_button"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpassword_cancel_label"/>
 
             <Button android:id="@+id/next_button"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpassword_continue_label"/>
 
         </LinearLayout>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 8a11a65..eb39aa2 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -50,7 +50,7 @@
         <item name="android:layout_width">wrap_content</item>
         <item name="android:layout_height">wrap_content</item>
     </style>
-    
+
     <style name="form_value">
         <item name="android:layout_height">wrap_content</item>
         <item name="android:layout_width">match_parent</item>
@@ -78,7 +78,7 @@
     <style name="TallTitleBarTheme" parent="android:Theme.NoTitleBar">
         <item name="android:windowContentOverlay">@null</item>
     </style>
-    
+
     <style name="Theme.CreateShortCut" parent="android:Theme.Holo.DialogWhenLarge">
     </style>
 
@@ -132,4 +132,18 @@
     <style name="CryptKeeperAnimation">
         <item name="android:windowExitAnimation">@anim/crypt_keeper_exit</item>
     </style>
+
+    <style name="SecurityPreferenceButtonContainer" parent="@android:style/Holo.SegmentedButton">
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:dividerPadding">8dip</item>
+    </style>
+
+    <style name="SecurityPreferenceButton" parent="@android:style/Widget.Holo.Button.Borderless">
+        <item name="android:layout_width">140dip</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:ellipsize">marquee</item>
+        <item name="android:singleLine">true</item>
+    </style>
+
 </resources>