diff options
Diffstat (limited to 'tools/layoutlib')
5 files changed, 15 insertions, 13 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java index 2df9219..990498f 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java @@ -16,7 +16,7 @@ package com.android.layoutlib.bridge; -import com.android.internal.util.XmlUtils; +import com.android.common.XmlUtils; import com.android.layoutlib.api.ILayoutBridge; import com.android.layoutlib.api.ILayoutLog; import com.android.layoutlib.api.ILayoutResult; diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeConstants.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeConstants.java index b5b7ceb..791e53b 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeConstants.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeConstants.java @@ -60,6 +60,7 @@ public class BridgeConstants { public final static String REFERENCE_STYLE = RES_STYLE + "/"; public final static String REFERENCE_NULL = "@null"; + public final static String MATCH_PARENT = "match_parent"; public final static String FILL_PARENT = "fill_parent"; public final static String WRAP_CONTENT = "wrap_content"; } diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeResources.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeResources.java index 1fafef4..6358abb 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeResources.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeResources.java @@ -239,8 +239,9 @@ public final class BridgeResources extends Resources { String v = value.getValue(); if (v != null) { - if (v.equals(BridgeConstants.FILL_PARENT)) { - return LayoutParams.FILL_PARENT; + if (v.equals(BridgeConstants.MATCH_PARENT) || + v.equals(BridgeConstants.FILL_PARENT)) { + return LayoutParams.MATCH_PARENT; } else if (v.equals(BridgeConstants.WRAP_CONTENT)) { return LayoutParams.WRAP_CONTENT; } diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeTypedArray.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeTypedArray.java index 957f737..efd222e 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeTypedArray.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeTypedArray.java @@ -16,7 +16,7 @@ package com.android.layoutlib.bridge; -import com.android.internal.util.XmlUtils; +import com.android.common.XmlUtils; import com.android.layoutlib.api.IResourceValue; import com.android.layoutlib.api.IStyleResourceValue; @@ -392,8 +392,8 @@ public final class BridgeTypedArray extends TypedArray { if (s == null) { return defValue; - } else if (s.equals(BridgeConstants.FILL_PARENT)) { - return LayoutParams.FILL_PARENT; + } else if (s.equals(BridgeConstants.MATCH_PARENT)) { + return LayoutParams.MATCH_PARENT; } else if (s.equals(BridgeConstants.WRAP_CONTENT)) { return LayoutParams.WRAP_CONTENT; } @@ -460,8 +460,8 @@ public final class BridgeTypedArray extends TypedArray { if (s == null) { return defValue; - } else if (s.equals(BridgeConstants.FILL_PARENT)) { - return LayoutParams.FILL_PARENT; + } else if (s.equals(BridgeConstants.MATCH_PARENT)) { + return LayoutParams.MATCH_PARENT; } else if (s.equals(BridgeConstants.WRAP_CONTENT)) { return LayoutParams.WRAP_CONTENT; } diff --git a/tools/layoutlib/bridge/tests/com/android/layoutlib/testdata/layout1.xml b/tools/layoutlib/bridge/tests/com/android/layoutlib/testdata/layout1.xml index 554f541..b8fc947 100644 --- a/tools/layoutlib/bridge/tests/com/android/layoutlib/testdata/layout1.xml +++ b/tools/layoutlib/bridge/tests/com/android/layoutlib/testdata/layout1.xml @@ -17,8 +17,8 @@ --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="fill_parent" + android:layout_width="match_parent" + android:layout_height="match_parent" android:orientation="vertical" > <Button @@ -31,8 +31,8 @@ </Button> <View android:id="@+id/surface" - android:layout_width="fill_parent" - android:layout_height="fill_parent" + android:layout_width="match_parent" + android:layout_height="match_parent" android:layout_weight="2" /> <TextView @@ -40,7 +40,7 @@ android:paddingLeft="2dip" android:layout_weight="0" android:background="@drawable/black" - android:layout_width="fill_parent" + android:layout_width="match_parent" android:layout_height="wrap_content" android:lines="1" android:gravity="center_vertical|center_horizontal" |