aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ScrollViewRule.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2010-12-09 14:49:13 -0800
committerTor Norbye <tnorbye@google.com>2010-12-09 14:49:13 -0800
commitfe3eebe57ba2925642cc1b257cb03ba617d298af (patch)
tree8a348ddd82b7b13754115a3a715fcc6e3990a8d4 /eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ScrollViewRule.java
parentf7bb5e5fe9c3e6cda5f6d2c4a1db4673a2f8f02d (diff)
downloadsdk-fe3eebe57ba2925642cc1b257cb03ba617d298af.zip
sdk-fe3eebe57ba2925642cc1b257cb03ba617d298af.tar.gz
sdk-fe3eebe57ba2925642cc1b257cb03ba617d298af.tar.bz2
Issue 13051: Use match_parent or fill_parent based on API level
Fixes issue 13051: New layout editor always insert "match_parent", even on older platform. View rules can now look up the API level of the current project, and based on that choose to use match_parent or fill_parent when they need to manipulate the layout attributes. Change-Id: I861e1f7f7409c40c05b1472268f120806667025c
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ScrollViewRule.java')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ScrollViewRule.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ScrollViewRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ScrollViewRule.java
index 822c1cb..e3c349a 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ScrollViewRule.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ScrollViewRule.java
@@ -20,7 +20,6 @@ import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI;
import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_HEIGHT;
import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_WIDTH;
import static com.android.ide.common.layout.LayoutConstants.FQCN_LINEAR_LAYOUT;
-import static com.android.ide.common.layout.LayoutConstants.VALUE_FILL_PARENT;
import com.android.ide.common.api.INode;
import com.android.ide.common.api.IViewRule;
@@ -36,8 +35,9 @@ public class ScrollViewRule extends FrameLayoutRule {
super.onChildInserted(child, parent, insertType);
// The child of the ScrollView should fill in both directions
- child.setAttribute(ANDROID_URI, ATTR_LAYOUT_WIDTH, VALUE_FILL_PARENT);
- child.setAttribute(ANDROID_URI, ATTR_LAYOUT_HEIGHT, VALUE_FILL_PARENT);
+ String fillParent = getFillParentValueName();
+ child.setAttribute(ANDROID_URI, ATTR_LAYOUT_WIDTH, fillParent);
+ child.setAttribute(ANDROID_URI, ATTR_LAYOUT_HEIGHT, fillParent);
}
@Override