* This does not override attributes which are not empty.
*/
public static void setDefaultLayoutAttributes(UiElementNode ui_node, boolean updateLayout) {
- // if this ui_node is a layout and we're adding it to a document, use fill_parent for
+ // if this ui_node is a layout and we're adding it to a document, use match_parent for
// both W/H. Otherwise default to wrap_layout.
boolean fill = ui_node.getDescriptor().hasChildren() &&
ui_node.getUiParent() instanceof UiDocumentNode;
public static final String ATTR_LAYOUT_X = "layout_x"; //$NON-NLS-1$
public static final String VALUE_WRAP_CONTENT = "wrap_content"; //$NON-NLS-1$
- public static final String VALUE_FILL_PARENT = "fill_parent"; //$NON-NLS-1$
+ public static final String VALUE_FILL_PARENT = "match_parent"; //$NON-NLS-1$
public static final String VALUE_TRUE = "true"; //$NON-NLS-1$
public static final String VALUE_N_DIP = "%ddip"; //$NON-NLS-1$
the special constants. -->
<attr name="layout_width" format="dimension">
<!-- The view should be as big as its parent (minus padding). -->
- <enum name="fill_parent" value="-1" />
+ <enum name="match_parent" value="-1" />
<!-- The view should be only big enough to enclose its content (plus padding). -->
<enum name="wrap_content" value="-2" />
</attr>
the special constants. -->
<attr name="layout_height" format="dimension">
<!-- The view should be as big as its parent (minus padding). -->
- <enum name="fill_parent" value="-1" />
+ <enum name="match_parent" value="-1" />
<!-- The view should be only big enough to enclose its content (plus padding). -->
<enum name="wrap_content" value="-2" />
</attr>
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[] {
}
/**
- * 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);
}
/**
- * 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);
//
// 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\""
//
// 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\""
// 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
<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"
<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
<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" />
<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" />
<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>
<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
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"
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"
<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"
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"
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"
</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"
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"
<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"
<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>