summaryrefslogtreecommitdiffstats
path: root/core/java/android/widget
diff options
context:
space:
mode:
authorJustin Ho <justinho@google.com>2012-10-17 16:06:15 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-10-17 16:06:15 -0700
commitf1149452694713670a5e3849693841c0fbab0f25 (patch)
tree6d564fa5187c8aaac81ee20f4f44785134c44e01 /core/java/android/widget
parent5c555f39fb9bb1a47c081ae62658454e92792f44 (diff)
parent22bd3726be37a24e956d962d61657d8a3d54c985 (diff)
downloadframeworks_base-f1149452694713670a5e3849693841c0fbab0f25.zip
frameworks_base-f1149452694713670a5e3849693841c0fbab0f25.tar.gz
frameworks_base-f1149452694713670a5e3849693841c0fbab0f25.tar.bz2
am 22bd3726: am 76a01424: am 871a6d7d: Merge "Revert "This restores JB MR0 behavior where the framework throws an exception for improper layouts that are missing layout_width and/or layout_height."" into jb-mr1-dev
* commit '22bd3726be37a24e956d962d61657d8a3d54c985': Revert "This restores JB MR0 behavior where the framework throws an exception for improper layouts that are missing layout_width and/or layout_height."
Diffstat (limited to 'core/java/android/widget')
-rw-r--r--core/java/android/widget/FrameLayout.java6
-rw-r--r--core/java/android/widget/RadioGroup.java27
-rw-r--r--core/java/android/widget/TableLayout.java9
-rw-r--r--core/java/android/widget/TableRow.java15
4 files changed, 10 insertions, 47 deletions
diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java
index e158776..45f30df 100644
--- a/core/java/android/widget/FrameLayout.java
+++ b/core/java/android/widget/FrameLayout.java
@@ -608,6 +608,12 @@ 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 78d05b0..42d63b2 100644
--- a/core/java/android/widget/RadioGroup.java
+++ b/core/java/android/widget/RadioGroup.java
@@ -297,33 +297,6 @@ 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 f4b2ce0..b65b421 100644
--- a/core/java/android/widget/TableLayout.java
+++ b/core/java/android/widget/TableLayout.java
@@ -741,14 +741,9 @@ 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;
- if (a.hasValue(heightAttr)) {
- this.height = a.getLayoutDimension(heightAttr, "layout_height");
- } else {
- this.height = WRAP_CONTENT;
- }
+ this.height = a.getLayoutDimension(heightAttr, WRAP_CONTENT);
}
}
diff --git a/core/java/android/widget/TableRow.java b/core/java/android/widget/TableRow.java
index a8cc406..a647d10 100644
--- a/core/java/android/widget/TableRow.java
+++ b/core/java/android/widget/TableRow.java
@@ -505,19 +505,8 @@ public class TableRow extends LinearLayout {
@Override
protected void setBaseAttributes(TypedArray a, int widthAttr, int heightAttr) {
- // 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;
- }
+ width = a.getLayoutDimension(widthAttr, MATCH_PARENT);
+ height = a.getLayoutDimension(heightAttr, WRAP_CONTENT);
}
}