diff options
author | Romain Guy <romainguy@google.com> | 2012-10-15 13:24:58 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2012-10-15 13:24:58 -0700 |
commit | 8e63bcc63fd002231f8391af8982eeb235d096c8 (patch) | |
tree | 75b2a0fceb1b7a366665b78bee09ac01786ee06e /core/java/android/widget | |
parent | a30d969401a8533a5a341664421ba9b1e150bac3 (diff) | |
download | frameworks_base-8e63bcc63fd002231f8391af8982eeb235d096c8.zip frameworks_base-8e63bcc63fd002231f8391af8982eeb235d096c8.tar.gz frameworks_base-8e63bcc63fd002231f8391af8982eeb235d096c8.tar.bz2 |
Revert "Fix for bug 6050753."
This reverts commit c29f031598811486d83f418fd08fbfe1fc41788a.
Diffstat (limited to 'core/java/android/widget')
-rw-r--r-- | core/java/android/widget/FrameLayout.java | 6 | ||||
-rw-r--r-- | core/java/android/widget/RadioGroup.java | 27 | ||||
-rw-r--r-- | core/java/android/widget/TableLayout.java | 9 | ||||
-rw-r--r-- | core/java/android/widget/TableRow.java | 15 |
4 files changed, 47 insertions, 10 deletions
diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java index 45f30df..e158776 100644 --- a/core/java/android/widget/FrameLayout.java +++ b/core/java/android/widget/FrameLayout.java @@ -608,12 +608,6 @@ public class FrameLayout extends ViewGroup { */ public int gravity = -1; - @Override - protected void setBaseAttributes(TypedArray a, int widthAttr, int heightAttr) { - width = a.getLayoutDimension(widthAttr, MATCH_PARENT); - height = a.getLayoutDimension(heightAttr, MATCH_PARENT); - } - /** * {@inheritDoc} */ diff --git a/core/java/android/widget/RadioGroup.java b/core/java/android/widget/RadioGroup.java index 42d63b2..78d05b0 100644 --- a/core/java/android/widget/RadioGroup.java +++ b/core/java/android/widget/RadioGroup.java @@ -297,6 +297,33 @@ public class RadioGroup extends LinearLayout { public LayoutParams(MarginLayoutParams source) { super(source); } + + /** + * <p>Fixes the child's width to + * {@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT} and the child's + * height to {@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT} + * when not specified in the XML file.</p> + * + * @param a the styled attributes set + * @param widthAttr the width attribute to fetch + * @param heightAttr the height attribute to fetch + */ + @Override + protected void setBaseAttributes(TypedArray a, + int widthAttr, int heightAttr) { + + if (a.hasValue(widthAttr)) { + width = a.getLayoutDimension(widthAttr, "layout_width"); + } else { + width = WRAP_CONTENT; + } + + if (a.hasValue(heightAttr)) { + height = a.getLayoutDimension(heightAttr, "layout_height"); + } else { + height = WRAP_CONTENT; + } + } } /** diff --git a/core/java/android/widget/TableLayout.java b/core/java/android/widget/TableLayout.java index 113299a..399b4fa 100644 --- a/core/java/android/widget/TableLayout.java +++ b/core/java/android/widget/TableLayout.java @@ -741,9 +741,14 @@ public class TableLayout extends LinearLayout { * @param heightAttr the height attribute to fetch */ @Override - protected void setBaseAttributes(TypedArray a, int widthAttr, int heightAttr) { + protected void setBaseAttributes(TypedArray a, + int widthAttr, int heightAttr) { this.width = MATCH_PARENT; - this.height = a.getLayoutDimension(heightAttr, WRAP_CONTENT); + if (a.hasValue(heightAttr)) { + this.height = a.getLayoutDimension(heightAttr, "layout_height"); + } else { + this.height = WRAP_CONTENT; + } } } diff --git a/core/java/android/widget/TableRow.java b/core/java/android/widget/TableRow.java index 3f8f9dae..68ffd73 100644 --- a/core/java/android/widget/TableRow.java +++ b/core/java/android/widget/TableRow.java @@ -505,8 +505,19 @@ public class TableRow extends LinearLayout { @Override protected void setBaseAttributes(TypedArray a, int widthAttr, int heightAttr) { - width = a.getLayoutDimension(widthAttr, MATCH_PARENT); - height = a.getLayoutDimension(heightAttr, WRAP_CONTENT); + // We don't want to force users to specify a layout_width + if (a.hasValue(widthAttr)) { + width = a.getLayoutDimension(widthAttr, "layout_width"); + } else { + width = MATCH_PARENT; + } + + // We don't want to force users to specify a layout_height + if (a.hasValue(heightAttr)) { + height = a.getLayoutDimension(heightAttr, "layout_height"); + } else { + height = WRAP_CONTENT; + } } } |