From 3d5f648f8fe61507107b900fc3c4cf79b19572c6 Mon Sep 17 00:00:00 2001
From: Dirk Dougherty
- *
* There are subclasses of LayoutParams for different subclasses of
* ViewGroup. For example, AbsoluteLayout has its own subclass of
@@ -3472,8 +3472,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
*/
public static class LayoutParams {
/**
- * This value has the same meaning as {@link #MATCH_PARENT} but has
- * been deprecated.
+ * Special value for the height or width requested by a View.
+ * FILL_PARENT means that the view wants to be as big as its parent,
+ * minus the parent's padding, if any. This value is deprecated
+ * starting in API Level 8 and replaced by {@link #MATCH_PARENT}.
*/
@SuppressWarnings({"UnusedDeclaration"})
@Deprecated
@@ -3482,7 +3484,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
/**
* Special value for the height or width requested by a View.
* MATCH_PARENT means that the view wants to be as big as its parent,
- * minus the parent's padding, if any.
+ * minus the parent's padding, if any. Introduced in API Level 8.
*/
public static final int MATCH_PARENT = -1;
@@ -3494,8 +3496,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
public static final int WRAP_CONTENT = -2;
/**
- * Information about how wide the view wants to be. Can be an exact
- * size, or one of the constants MATCH_PARENT or WRAP_CONTENT.
+ * Information about how wide the view wants to be. Can be one of the
+ * constants FILL_PARENT (replaced by MATCH_PARENT ,
+ * in API Level 8) or WRAP_CONTENT. or an exact size.
*/
@ViewDebug.ExportedProperty(mapping = {
@ViewDebug.IntToString(from = MATCH_PARENT, to = "MATCH_PARENT"),
@@ -3504,8 +3507,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
public int width;
/**
- * Information about how tall the view wants to be. Can be an exact
- * size, or one of the constants MATCH_PARENT or WRAP_CONTENT.
+ * Information about how tall the view wants to be. Can be one of the
+ * constants FILL_PARENT (replaced by MATCH_PARENT ,
+ * in API Level 8) or WRAP_CONTENT. or an exact size.
*/
@ViewDebug.ExportedProperty(mapping = {
@ViewDebug.IntToString(from = MATCH_PARENT, to = "MATCH_PARENT"),
@@ -3525,9 +3529,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
*
*
*
*
* @param c the application environment
@@ -3546,10 +3552,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
* Creates a new set of layout parameters with the specified width
* and height.
*
- * @param width the width, either {@link #MATCH_PARENT},
- * {@link #WRAP_CONTENT} or a fixed size in pixels
- * @param height the height, either {@link #MATCH_PARENT},
- * {@link #WRAP_CONTENT} or a fixed size in pixels
+ * @param width the width, either {@link #WRAP_CONTENT},
+ * {@link #FILL_PARENT} (replaced by {@link #MATCH_PARENT} in
+ * API Level 8), or a fixed size in pixels
+ * @param height the height, either {@link #WRAP_CONTENT},
+ * {@link #FILL_PARENT} (replaced by {@link #MATCH_PARENT} in
+ * API Level 8), or a fixed size in pixels
*/
public LayoutParams(int width, int height) {
this.width = width;
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 24808ec7217ea..16b241bed7bd4 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -1396,9 +1396,12 @@
be a dimension (such as "12dip") for a constant width or one of
the special constants. -->
layout_width: the width, either an exact value,
- * {@link #WRAP_CONTENT} or {@link #MATCH_PARENT}layout_height: the height, either an exact value,
- * {@link #WRAP_CONTENT} or {@link #MATCH_PARENT}
All view groups include a width and height (layout_width and layout_height),
-and each view is required to define them.
-Many LayoutParams also include optional margins and
-borders. You can specify width and height with exact measurements, though you probably won't want
-to do this often. More often, you will tell your view to size itself either to
-the dimensions required by its content, or to become as big as its parent view group
-will allow (with the wrap_content and fill_parent values, respectively).
-The accepted measurement types are defined in the
-Available Resources document.
All view groups include a width and height (layout_width and
+layout_height), and each view is required to define them. Many
+LayoutParams also include optional margins and borders.
+ +
You can specify width and height with exact measurements, though you probably +won't want to do this often. More often, you will use one of these constants to +set the width or height:
+ +In general, specifying a layout width and height using absolute units such as +pixels is not recommended. Instead, using relative measurements such as +density-independent pixel units (dp), wrap_content, or +fill_parent, is a better approach, because it helps ensure that +your application will display properly across a variety of device screen sizes. +The accepted measurement types are defined in the + +Available Resources document.