summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2011-08-08 21:05:02 -0700
committerJeff Sharkey <jsharkey@android.com>2011-08-11 14:53:49 -0700
commit010d7e51604b1cffed6c4a16ba1f8b2527fd27e8 (patch)
tree2c48cad1ff21bff74a0b846884e49c7056528f4c
parent8cceb1e42b76aabcd6c27cfe599f7cd251a84947 (diff)
downloadframeworks_base-010d7e51604b1cffed6c4a16ba1f8b2527fd27e8.zip
frameworks_base-010d7e51604b1cffed6c4a16ba1f8b2527fd27e8.tar.gz
frameworks_base-010d7e51604b1cffed6c4a16ba1f8b2527fd27e8.tar.bz2
Change Preferences padding to match UI spec.
Bug: 5091431 Change-Id: I1b657534c3ecccbddda1bece910da7f31d85291c
-rw-r--r--core/java/android/view/View.java6
-rw-r--r--core/res/res/layout/preference_category_holo.xml4
-rw-r--r--core/res/res/layout/preference_child_holo.xml13
-rw-r--r--core/res/res/layout/preference_holo.xml14
-rw-r--r--core/res/res/layout/preference_information_holo.xml14
-rw-r--r--core/res/res/values-w720dp/dimens.xml2
-rw-r--r--core/res/res/values/dimens.xml4
7 files changed, 33 insertions, 24 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index ad76928..2b2e201 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -8753,6 +8753,12 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
* @see #SCROLLBARS_OUTSIDE_OVERLAY
* @see #SCROLLBARS_OUTSIDE_INSET
*/
+ @ViewDebug.ExportedProperty(mapping = {
+ @ViewDebug.IntToString(from = SCROLLBARS_INSIDE_OVERLAY, to = "INSIDE_OVERLAY"),
+ @ViewDebug.IntToString(from = SCROLLBARS_INSIDE_INSET, to = "INSIDE_INSET"),
+ @ViewDebug.IntToString(from = SCROLLBARS_OUTSIDE_OVERLAY, to = "OUTSIDE_OVERLAY"),
+ @ViewDebug.IntToString(from = SCROLLBARS_OUTSIDE_INSET, to = "OUTSIDE_INSET")
+ })
public int getScrollBarStyle() {
return mViewFlags & SCROLLBARS_STYLE_MASK;
}
diff --git a/core/res/res/layout/preference_category_holo.xml b/core/res/res/layout/preference_category_holo.xml
index a4e20d2..81e595c 100644
--- a/core/res/res/layout/preference_category_holo.xml
+++ b/core/res/res/layout/preference_category_holo.xml
@@ -18,5 +18,5 @@
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
style="?android:attr/listSeparatorTextViewStyle"
android:id="@+android:id/title"
- android:paddingLeft="16dp"
-/>
+ android:paddingLeft="@dimen/preference_item_padding_side"
+ android:paddingRight="@dimen/preference_item_padding_side" />
diff --git a/core/res/res/layout/preference_child_holo.xml b/core/res/res/layout/preference_child_holo.xml
index 06c846b..3c6a12e 100644
--- a/core/res/res/layout/preference_child_holo.xml
+++ b/core/res/res/layout/preference_child_holo.xml
@@ -20,7 +20,7 @@
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
- android:paddingLeft="16dip"
+ android:paddingLeft="@dimen/preference_child_padding_side"
android:paddingRight="?android:attr/scrollbarSize">
<LinearLayout
@@ -34,17 +34,16 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
- />
+ android:paddingRight="@dimen/preference_item_padding_inner" />
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="32dip"
- android:layout_marginRight="6dip"
- android:layout_marginTop="6dip"
- android:layout_marginBottom="6dip"
- android:layout_weight="1">
+ android:layout_weight="1"
+ android:paddingRight="@dimen/preference_item_padding_inner"
+ android:paddingTop="6dip"
+ android:paddingBottom="6dip">
<TextView android:id="@+android:id/title"
android:layout_width="wrap_content"
diff --git a/core/res/res/layout/preference_holo.xml b/core/res/res/layout/preference_holo.xml
index e5ed33c..48f483d 100644
--- a/core/res/res/layout/preference_holo.xml
+++ b/core/res/res/layout/preference_holo.xml
@@ -22,6 +22,7 @@
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
+ android:paddingLeft="@dimen/preference_item_padding_side"
android:paddingRight="?android:attr/scrollbarSize">
<LinearLayout
@@ -36,18 +37,17 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:minWidth="48dp"
- />
+ android:paddingRight="@dimen/preference_item_padding_inner" />
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="16dip"
- android:layout_marginRight="8dip"
- android:layout_marginTop="6dip"
- android:layout_marginBottom="6dip"
- android:layout_weight="1">
-
+ android:layout_weight="1"
+ android:paddingRight="@dimen/preference_item_padding_inner"
+ android:paddingTop="6dip"
+ android:paddingBottom="6dip">
+
<TextView android:id="@+android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/core/res/res/layout/preference_information_holo.xml b/core/res/res/layout/preference_information_holo.xml
index d15cd7b..e29ed03 100644
--- a/core/res/res/layout/preference_information_holo.xml
+++ b/core/res/res/layout/preference_information_holo.xml
@@ -22,6 +22,7 @@
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
+ android:paddingLeft="@dimen/preference_item_padding_side"
android:paddingRight="?android:attr/scrollbarSize">
<LinearLayout
@@ -35,17 +36,16 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
- />
+ android:paddingRight="@dimen/preference_item_padding_inner" />
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="16dip"
- android:layout_marginRight="6sp"
- android:layout_marginTop="6sp"
- android:layout_marginBottom="6sp"
- android:layout_weight="1">
+ android:layout_weight="1"
+ android:paddingRight="@dimen/preference_item_padding_inner"
+ android:paddingTop="6dip"
+ android:paddingBottom="6dip">
<TextView android:id="@+android:id/title"
android:layout_width="wrap_content"
@@ -64,7 +64,7 @@
android:maxLines="2" />
</RelativeLayout>
-
+
<!-- Preference should place its actual preference widget here. -->
<LinearLayout android:id="@+android:id/widget_frame"
android:layout_width="wrap_content"
diff --git a/core/res/res/values-w720dp/dimens.xml b/core/res/res/values-w720dp/dimens.xml
index ec1195e..3d10103 100644
--- a/core/res/res/values-w720dp/dimens.xml
+++ b/core/res/res/values-w720dp/dimens.xml
@@ -28,5 +28,5 @@
<!-- Minimum space to allocate to the left of a preference item for an icon.
This helps in aligning titles when some items have icons and some don't. When space is
at a premium, we don't pre-allocate any space. -->
- <dimen name="preference_icon_minWidth">48dp</dimen>
+ <dimen name="preference_icon_minWidth">56dp</dimen>
</resources>
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index e534e9b..f975bbe 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -104,6 +104,10 @@
<!-- Preference activity, vertical padding for the header list -->
<dimen name="preference_screen_header_vertical_padding">0dp</dimen>
+ <dimen name="preference_item_padding_side">8dip</dimen>
+ <dimen name="preference_item_padding_inner">8dip</dimen>
+ <dimen name="preference_child_padding_side">16dip</dimen>
+
<!-- The platform's desired minimum size for a dialog's width when it
is along the minor axis (that is the screen is portrait). This may
be either a fraction or a dimension. -->