Build 1.0_r1(from source)

android.view
Class ViewGroup.LayoutParams

java.lang.Object
  extended by android.view.ViewGroup.LayoutParams
Direct Known Subclasses:
AbsListView.LayoutParams, AbsoluteLayout.LayoutParams, Gallery.LayoutParams, ViewGroup.MarginLayoutParams, WindowManager.LayoutParams
Enclosing class:
ViewGroup

public static class ViewGroup.LayoutParams
extends Object

LayoutParams are used by views to tell their parents how they want to be laid out. See ViewGroup Layout Attributes for a list of all child view attributes that this class supports.

The base LayoutParams class just describes how big the view wants to be for both width and height. For each dimension, it can specify one of:

There are subclasses of LayoutParams for different subclasses of ViewGroup. For example, AbsoluteLayout has its own subclass of LayoutParams which adds an X and Y value.


Field Summary
static int FILL_PARENT
          Special value for the height or width requested by a View.
 int height
          Information about how tall the view wants to be.
 LayoutAnimationController.AnimationParameters layoutAnimationParameters
          Used to animate layouts.
 int width
          Information about how wide the view wants to be.
static int WRAP_CONTENT
          Special value for the height or width requested by a View.
 
Constructor Summary
ViewGroup.LayoutParams()
          Used internally by MarginLayoutParams.
ViewGroup.LayoutParams(Context c, AttributeSet attrs)
          Creates a new set of layout parameters.
ViewGroup.LayoutParams(int width, int height)
          Creates a new set of layout parameters with the specified width and height.
ViewGroup.LayoutParams(ViewGroup.LayoutParams source)
          Copy constructor.
 
Method Summary
 String debug(String output)
          Returns a String representation of this set of layout parameters.
protected  void setBaseAttributes(TypedArray a, int widthAttr, int heightAttr)
          Extracts the layout parameters from the supplied attributes.
protected static String sizeToString(int size)
          Converts the specified size to a readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILL_PARENT

public static final int FILL_PARENT
Special value for the height or width requested by a View. FILL_PARENT means that the view wants to fill the available space within the parent, taking the parent's padding into account.

See Also:
Constant Field Values

WRAP_CONTENT

public static final int WRAP_CONTENT
Special value for the height or width requested by a View. WRAP_CONTENT means that the view wants to be just large enough to fit its own internal content, taking its own padding into account.

See Also:
Constant Field Values

width

public int width
Information about how wide the view wants to be. Can be an exact size, or one of the constants FILL_PARENT or WRAP_CONTENT.


height

public int height
Information about how tall the view wants to be. Can be an exact size, or one of the constants FILL_PARENT or WRAP_CONTENT.


layoutAnimationParameters

public LayoutAnimationController.AnimationParameters layoutAnimationParameters
Used to animate layouts.

Constructor Detail

ViewGroup.LayoutParams

public ViewGroup.LayoutParams(Context c,
                              AttributeSet attrs)
Creates a new set of layout parameters. The values are extracted from the supplied attributes set and context. The XML attributes mapped to this set of layout parameters are:

Parameters:
c - the application environment
attrs - the set of attributes from which to extract the layout parameters' values

ViewGroup.LayoutParams

public ViewGroup.LayoutParams(int width,
                              int height)
Creates a new set of layout parameters with the specified width and height.

Parameters:
width - the width, either FILL_PARENT, WRAP_CONTENT or a fixed size in pixels
height - the height, either FILL_PARENT, WRAP_CONTENT or a fixed size in pixels

ViewGroup.LayoutParams

public ViewGroup.LayoutParams(ViewGroup.LayoutParams source)
Copy constructor. Clones the width and height values of the source.

Parameters:
source - The layout params to copy from.

ViewGroup.LayoutParams

ViewGroup.LayoutParams()
Used internally by MarginLayoutParams.

Method Detail

setBaseAttributes

protected void setBaseAttributes(TypedArray a,
                                 int widthAttr,
                                 int heightAttr)
Extracts the layout parameters from the supplied attributes.

Parameters:
a - the style attributes to extract the parameters from
widthAttr - the identifier of the width attribute
heightAttr - the identifier of the height attribute

debug

public String debug(String output)
Returns a String representation of this set of layout parameters.

Parameters:
output - the String to prepend to the internal representation
Returns:
a String with the following format: output + "ViewGroup.LayoutParams={ width=WIDTH, height=HEIGHT }"

sizeToString

protected static String sizeToString(int size)
Converts the specified size to a readable String.

Parameters:
size - the size to convert
Returns:
a String instance representing the supplied size

Build 1.0_r1(from source)

Please submit a feedback, bug or feature