aboutsummaryrefslogtreecommitdiffstats
path: root/layoutopt
diff options
context:
space:
mode:
authorRomain Guy <romainguy@android.com>2010-01-08 15:07:24 -0800
committerRomain Guy <romainguy@android.com>2010-01-08 15:12:07 -0800
commit6ca40b28e8acc510deb806a216b9c3e9aa164e7e (patch)
tree544fd7d99b1a6659cc10b1fc3c791cddb8551089 /layoutopt
parent62bb30a97d16d007a05b5db51a7b5213ef041f64 (diff)
downloadsdk-6ca40b28e8acc510deb806a216b9c3e9aa164e7e.zip
sdk-6ca40b28e8acc510deb806a216b9c3e9aa164e7e.tar.gz
sdk-6ca40b28e8acc510deb806a216b9c3e9aa164e7e.tar.bz2
Deprecate fill_parent and introduce match_parent.
Bug: #2361749.
Diffstat (limited to 'layoutopt')
-rw-r--r--layoutopt/libs/uix/src/com/android/layoutopt/uix/groovy/LayoutAnalysisCategory.java6
-rw-r--r--layoutopt/libs/uix/src/resources/rules/IncorrectHeightInScrollView.rule2
-rw-r--r--layoutopt/libs/uix/src/resources/rules/IncorrectWidthInHorizontalScrollView.rule2
-rw-r--r--layoutopt/libs/uix/src/resources/rules/MergeRootFrameLayout.rule2
-rw-r--r--layoutopt/samples/compound.xml4
-rw-r--r--layoutopt/samples/has_children.xml8
-rw-r--r--layoutopt/samples/inefficient_weight.xml18
-rw-r--r--layoutopt/samples/scrolling.xml12
-rw-r--r--layoutopt/samples/simple.xml4
-rw-r--r--layoutopt/samples/too_deep.xml48
-rw-r--r--layoutopt/samples/too_many.xml20
-rw-r--r--layoutopt/samples/useless.xml8
-rw-r--r--layoutopt/samples/wrong_dimension.xml8
13 files changed, 71 insertions, 71 deletions
diff --git a/layoutopt/libs/uix/src/com/android/layoutopt/uix/groovy/LayoutAnalysisCategory.java b/layoutopt/libs/uix/src/com/android/layoutopt/uix/groovy/LayoutAnalysisCategory.java
index a70086d..508a277 100644
--- a/layoutopt/libs/uix/src/com/android/layoutopt/uix/groovy/LayoutAnalysisCategory.java
+++ b/layoutopt/libs/uix/src/com/android/layoutopt/uix/groovy/LayoutAnalysisCategory.java
@@ -42,7 +42,7 @@ public class LayoutAnalysisCategory {
private static final String ANDROID_PADDING_BOTTOM = "android:paddingBottom";
private static final String ANDROID_LAYOUT_WIDTH = "android:layout_width";
private static final String ANDROID_LAYOUT_HEIGHT = "android:layout_height";
- private static final String VALUE_FILL_PARENT = "fill_parent";
+ private static final String VALUE_FILL_PARENT = "match_parent";
private static final String VALUE_WRAP_CONTENT = "wrap_content";
private static final String[] sContainers = new String[] {
@@ -118,7 +118,7 @@ public class LayoutAnalysisCategory {
}
/**
- * Returns whether this node's width is fill_parent.
+ * Returns whether this node's width is match_parent.
*/
public static boolean isWidthFillParent(Element element) {
return element.getAttribute(ANDROID_LAYOUT_WIDTH).equals(VALUE_FILL_PARENT);
@@ -132,7 +132,7 @@ public class LayoutAnalysisCategory {
}
/**
- * Returns whether this node's height is fill_parent.
+ * Returns whether this node's height is match_parent.
*/
public static boolean isHeightFillParent(Element element) {
return element.getAttribute(ANDROID_LAYOUT_HEIGHT).equals(VALUE_FILL_PARENT);
diff --git a/layoutopt/libs/uix/src/resources/rules/IncorrectHeightInScrollView.rule b/layoutopt/libs/uix/src/resources/rules/IncorrectHeightInScrollView.rule
index d29ebd5..36d3c2e 100644
--- a/layoutopt/libs/uix/src/resources/rules/IncorrectHeightInScrollView.rule
+++ b/layoutopt/libs/uix/src/resources/rules/IncorrectHeightInScrollView.rule
@@ -4,7 +4,7 @@
//
// Conditions:
// - The node has a ScrollView parent
-// - The node has a height set to fill_parent
+// - The node has a height set to match_parent
if (node.'..'.is("ScrollView") && node.isHeightFillParent()) {
analysis << "This ${node.name()} tag should use android:layout_height=\"wrap_content\""
diff --git a/layoutopt/libs/uix/src/resources/rules/IncorrectWidthInHorizontalScrollView.rule b/layoutopt/libs/uix/src/resources/rules/IncorrectWidthInHorizontalScrollView.rule
index 17da843..b96e034 100644
--- a/layoutopt/libs/uix/src/resources/rules/IncorrectWidthInHorizontalScrollView.rule
+++ b/layoutopt/libs/uix/src/resources/rules/IncorrectWidthInHorizontalScrollView.rule
@@ -4,7 +4,7 @@
//
// Conditions:
// - The node has a HorizontalScrollView parent
-// - The node has a width set to fill_parent
+// - The node has a width set to match_parent
if (node.'..'.is("HorizontalScrollView") && node.isWidthFillParent()) {
analysis << "This ${node.name()} tag should use android:layout_width=\"wrap_content\""
diff --git a/layoutopt/libs/uix/src/resources/rules/MergeRootFrameLayout.rule b/layoutopt/libs/uix/src/resources/rules/MergeRootFrameLayout.rule
index d3fc3d9..c477155 100644
--- a/layoutopt/libs/uix/src/resources/rules/MergeRootFrameLayout.rule
+++ b/layoutopt/libs/uix/src/resources/rules/MergeRootFrameLayout.rule
@@ -6,7 +6,7 @@
// Conditions:
// - The node is the root of the document
// - The node is a FrameLayout
-// - The node is fill_parent in both orientation *or* it has no layout_gravity
+// - The node is match_parent in both orientation *or* it has no layout_gravity
// - The node does not have a background nor a foreground
// - The node does not have padding
diff --git a/layoutopt/samples/compound.xml b/layoutopt/samples/compound.xml
index 176089b..f7b28ef 100644
--- a/layoutopt/samples/compound.xml
+++ b/layoutopt/samples/compound.xml
@@ -3,8 +3,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">
<ImageView
android:layout_width="wrap_content"
diff --git a/layoutopt/samples/has_children.xml b/layoutopt/samples/has_children.xml
index f216db5..3e663b2 100644
--- a/layoutopt/samples/has_children.xml
+++ b/layoutopt/samples/has_children.xml
@@ -3,11 +3,11 @@
<ListView
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">
<ListView
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" />
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
</ListView> \ No newline at end of file
diff --git a/layoutopt/samples/inefficient_weight.xml b/layoutopt/samples/inefficient_weight.xml
index 785350a..81c8b71 100644
--- a/layoutopt/samples/inefficient_weight.xml
+++ b/layoutopt/samples/inefficient_weight.xml
@@ -3,24 +3,24 @@
<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">
<Button
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.0" />
<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
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.0" />
@@ -29,13 +29,13 @@
<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
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1.0" />
diff --git a/layoutopt/samples/scrolling.xml b/layoutopt/samples/scrolling.xml
index 534289c..9eb862f 100644
--- a/layoutopt/samples/scrolling.xml
+++ b/layoutopt/samples/scrolling.xml
@@ -3,16 +3,16 @@
<ScrollView
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">
<LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<ListView
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" />
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
</LinearLayout>
diff --git a/layoutopt/samples/simple.xml b/layoutopt/samples/simple.xml
index 1fd36e2..d462c69 100644
--- a/layoutopt/samples/simple.xml
+++ b/layoutopt/samples/simple.xml
@@ -3,5 +3,5 @@
<FrameLayout
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" />
diff --git a/layoutopt/samples/too_deep.xml b/layoutopt/samples/too_deep.xml
index 7317362..0c617b8 100644
--- a/layoutopt/samples/too_deep.xml
+++ b/layoutopt/samples/too_deep.xml
@@ -3,8 +3,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">
<Button
android:layout_width="wrap_content"
@@ -12,48 +12,48 @@
android:text="Ok" />
<LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<Button
android:layout_width="wrap_content"
diff --git a/layoutopt/samples/too_many.xml b/layoutopt/samples/too_many.xml
index 41c18ff..2ea266d 100644
--- a/layoutopt/samples/too_many.xml
+++ b/layoutopt/samples/too_many.xml
@@ -3,8 +3,8 @@
<FrameLayout
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">
<Button
android:layout_width="wrap_content"
@@ -67,8 +67,8 @@
android:text="Ok" />
<LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<Button
android:layout_width="wrap_content"
@@ -151,8 +151,8 @@
android:text="Ok" />
<LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<Button
android:layout_width="wrap_content"
@@ -239,8 +239,8 @@
</LinearLayout>
<LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<Button
android:layout_width="wrap_content"
@@ -323,8 +323,8 @@
android:text="Ok" />
<LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<Button
android:layout_width="wrap_content"
diff --git a/layoutopt/samples/useless.xml b/layoutopt/samples/useless.xml
index 1c2d5d8..61b70af 100644
--- a/layoutopt/samples/useless.xml
+++ b/layoutopt/samples/useless.xml
@@ -3,12 +3,12 @@
<FrameLayout
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">
<LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
diff --git a/layoutopt/samples/wrong_dimension.xml b/layoutopt/samples/wrong_dimension.xml
index c0b292b..79b922b 100644
--- a/layoutopt/samples/wrong_dimension.xml
+++ b/layoutopt/samples/wrong_dimension.xml
@@ -3,11 +3,11 @@
<HorizontalScrollView
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">
<LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" />
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
</HorizontalScrollView>