diff options
author | Romain Guy <romainguy@android.com> | 2010-01-08 15:06:28 -0800 |
---|---|---|
committer | Romain Guy <romainguy@android.com> | 2010-01-08 15:11:38 -0800 |
commit | 980a938c1c9a6a5791a8240e5a1e6638ab28dc77 (patch) | |
tree | 75a3a1347b5423cc98859d3976076cea3dc22564 /tools/layoutlib | |
parent | 0a0289420227fee51406cf4cc508f09d8ecdd2f4 (diff) | |
download | frameworks_base-980a938c1c9a6a5791a8240e5a1e6638ab28dc77.zip frameworks_base-980a938c1c9a6a5791a8240e5a1e6638ab28dc77.tar.gz frameworks_base-980a938c1c9a6a5791a8240e5a1e6638ab28dc77.tar.bz2 |
Deprecate fill_parent and introduce match_parent.
Bug: #2361749.
Diffstat (limited to 'tools/layoutlib')
4 files changed, 14 insertions, 12 deletions
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..573af1e 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 FILL_PARENT = "fill_parent"; + public final static String MATCH_PARENT = "match_parent"; + public final static String FILL_PARENT = "match_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 6f203ba..efd222e 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeTypedArray.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeTypedArray.java @@ -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" |