summaryrefslogtreecommitdiffstats
path: root/core/java/android/widget/RadioGroup.java
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-10-15 18:44:07 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-15 18:45:03 -0700
commit69fbc3c089e3399ebd94cc3a7ba846f426a7b32d (patch)
treeab0cfa10e24e387db1f18a0547910b405657c5a1 /core/java/android/widget/RadioGroup.java
parentedefaa25db7c9cd4facab258a0fd5913c6493bd0 (diff)
parent8e63bcc63fd002231f8391af8982eeb235d096c8 (diff)
downloadframeworks_base-69fbc3c089e3399ebd94cc3a7ba846f426a7b32d.zip
frameworks_base-69fbc3c089e3399ebd94cc3a7ba846f426a7b32d.tar.gz
frameworks_base-69fbc3c089e3399ebd94cc3a7ba846f426a7b32d.tar.bz2
Merge "Revert "Fix for bug 6050753."" into jb-mr1-dev
Diffstat (limited to 'core/java/android/widget/RadioGroup.java')
-rw-r--r--core/java/android/widget/RadioGroup.java27
1 files changed, 27 insertions, 0 deletions
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;
+ }
+ }
}
/**