public static class RelativeLayout.LayoutParams extends ViewGroup.MarginLayoutParams
Modifier and Type | Field and Description |
---|---|
boolean |
alignWithParent
When true, uses the parent as the anchor if the anchor doesn't exist or if
the anchor's visibility is GONE.
|
bottomMargin, DEFAULT_RELATIVE, leftMargin, rightMargin, topMargin
FILL_PARENT, height, layoutAnimationParameters, MATCH_PARENT, width, WRAP_CONTENT
Constructor and Description |
---|
RelativeLayout.LayoutParams(Context c,
AttributeSet attrs) |
RelativeLayout.LayoutParams(int w,
int h) |
RelativeLayout.LayoutParams(ViewGroup.LayoutParams source) |
RelativeLayout.LayoutParams(ViewGroup.MarginLayoutParams source) |
Modifier and Type | Method and Description |
---|---|
void |
addRule(int verb)
Adds a layout rule to be interpreted by the RelativeLayout.
|
void |
addRule(int verb,
int anchor)
Adds a layout rule to be interpreted by the RelativeLayout.
|
String |
debug(String output)
Returns a String representation of this set of layout parameters.
|
int[] |
getRules()
Retrieves a complete list of all supported rules, where the index is the rule
verb, and the element value is the value specified, or "false" if it was never
set.
|
int[] |
getRules(int layoutDirection)
Retrieves a complete list of all supported rules, where the index is the rule
verb, and the element value is the value specified, or "false" if it was never
set.
|
void |
removeRule(int verb)
Removes a layout rule to be interpreted by the RelativeLayout.
|
void |
resolveLayoutDirection(int layoutDirection)
This will be called by
View.requestLayout() . |
getLayoutDirection, getMarginEnd, getMarginStart, isLayoutRtl, isMarginRelative, onDebugDraw, setLayoutDirection, setMarginEnd, setMargins, setMarginsRelative, setMarginStart
setBaseAttributes, sizeToString
public boolean alignWithParent
public RelativeLayout.LayoutParams(Context c, AttributeSet attrs)
public RelativeLayout.LayoutParams(int w, int h)
public RelativeLayout.LayoutParams(ViewGroup.LayoutParams source)
public RelativeLayout.LayoutParams(ViewGroup.MarginLayoutParams source)
public String debug(String output)
ViewGroup.LayoutParams
debug
in class ViewGroup.LayoutParams
output
- the String to prepend to the internal representationpublic void addRule(int verb)
RelativeLayout.TRUE
for true or 0 for false). To specify a verb that takes a subject, use
addRule(int, int)
instead.verb
- One of the verbs defined by
RelativeLayout
, such as
ALIGN_WITH_PARENT_LEFT.addRule(int, int)
public void addRule(int verb, int anchor)
verb
- One of the verbs defined by
RelativeLayout
, such as
ALIGN_WITH_PARENT_LEFT.anchor
- The id of another view to use as an anchor,
or a boolean value(represented as RelativeLayout.TRUE
)
for true or 0 for false). For verbs that don't refer to another sibling
(for example, ALIGN_WITH_PARENT_BOTTOM) just use -1.addRule(int)
public void removeRule(int verb)
verb
- One of the verbs defined by
RelativeLayout
, such as
ALIGN_WITH_PARENT_LEFT.addRule(int)
,
addRule(int, int)
public int[] getRules(int layoutDirection)
layoutDirection
- the direction of the layout.
Should be either View.LAYOUT_DIRECTION_LTR
or View.LAYOUT_DIRECTION_RTL
addRule(int, int)
public int[] getRules()
addRule(int, int)
public void resolveLayoutDirection(int layoutDirection)
ViewGroup.MarginLayoutParams
View.requestLayout()
. Left and Right margins
may be overridden depending on layout direction.resolveLayoutDirection
in class ViewGroup.MarginLayoutParams
layoutDirection
- the direction of the layout
View.LAYOUT_DIRECTION_LTR
View.LAYOUT_DIRECTION_RTL