OSDN Git Service

Fix 3383575: use styled attribs and update layout
authorJim Miller <jaggies@google.com>
Tue, 25 Jan 2011 05:25:47 +0000 (21:25 -0800)
committerJim Miller <jaggies@google.com>
Tue, 25 Jan 2011 20:29:35 +0000 (12:29 -0800)
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

res/layout-xlarge-land/choose_lock_password.xml
res/layout-xlarge-land/choose_lock_pattern.xml
res/layout-xlarge-land/choose_lock_pattern_tutorial.xml
res/layout-xlarge-land/confirm_lock_password.xml
res/layout-xlarge/choose_lock_password.xml
res/layout-xlarge/choose_lock_pattern.xml
res/layout-xlarge/choose_lock_pattern_tutorial.xml
res/layout-xlarge/confirm_lock_password.xml
res/values/styles.xml

index 586e7d5..9518672 100644 (file)
 
     <!-- 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>
index e2cbdab..fc5e787 100644 (file)
 
         <!-- 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>
index 56addbb..32b452d 100644 (file)
             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>
index 7ae8944..3874f11 100644 (file)
 
     <!-- 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>
index f923971..c8a0866 100644 (file)
         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>
index 5995c26..6b7b90e 100644 (file)
         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>
index ea09727..c7bdc88 100644 (file)
         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>
index abb0d79..5ffc5e7 100644 (file)
         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>
index 8a11a65..eb39aa2 100644 (file)
@@ -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>
 
     <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>