Package icyllis.modernui.view
Class ViewGroup.LayoutParams
java.lang.Object
icyllis.modernui.view.ViewGroup.LayoutParams
- Direct Known Subclasses:
AbsListView.LayoutParams
,AbsoluteLayout.LayoutParams
,ViewGroup.MarginLayoutParams
,ViewPager.LayoutParams
,WindowManager.LayoutParams
- Enclosing class:
ViewGroup
LayoutParams are used by views to tell their parents how they want to
be laid out.
The base LayoutParams class just describes how big the view wants to be for both width and height.
There are subclasses of LayoutParams for different subclasses of ViewGroup.
-
Field Summary
Modifier and TypeFieldDescriptionint
Information about how tall the view wants to be.static final int
Special value for the height or width requested by a View.int
Information about how wide the view wants to be.static final int
Special value for the height or width requested by a View. -
Constructor Summary
ConstructorDescriptionLayoutParams
(int width, int height) Creates a new set of layout parameters with the specified width and height.LayoutParams
(ViewGroup.LayoutParams source) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
resolveLayoutDirection
(int layoutDirection) Resolve layout parameters depending on the layout direction.
-
Field Details
-
MATCH_PARENT
public static final int MATCH_PARENTSpecial 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. Introduced in API Level 8.- See Also:
-
WRAP_CONTENT
public static final int WRAP_CONTENTSpecial 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:
-
width
public int widthInformation about how wide the view wants to be. Can be one of the constants MATCH_PARENT or WRAP_CONTENT, or an exact size. -
height
public int heightInformation about how tall the view wants to be. Can be one of the constants MATCH_PARENT or WRAP_CONTENT, or an exact size.
-
-
Constructor Details
-
LayoutParams
public LayoutParams(int width, int height) Creates a new set of layout parameters with the specified width and height.- Parameters:
width
- the width, eitherWRAP_CONTENT
,MATCH_PARENT
, or a size in pixelsheight
- the height, eitherWRAP_CONTENT
,MATCH_PARENT
, or a size in pixels
-
LayoutParams
Copy constructor. Clones the width and height values of the source.- Parameters:
source
- the layout params to copy from.
-
-
Method Details
-
resolveLayoutDirection
public void resolveLayoutDirection(int layoutDirection) Resolve layout parameters depending on the layout direction. Subclasses that care about layoutDirection changes should override this method. The default implementation does nothing.- Parameters:
layoutDirection
- the direction of the layout- See Also:
-