public static class CoordinatorLayout.LayoutParams extends ViewGroup.MarginLayoutParams
CoordinatorLayout
.Modifier and Type | Field and Description |
---|---|
int |
anchorGravity
|
int |
dodgeInsetEdges
A
Gravity value describing how this child view dodges any inset child views in
the CoordinatorLayout. |
int |
gravity
A
Gravity value describing how this child view should lay out. |
int |
insetEdge
A
Gravity value describing how this child view insets the CoordinatorLayout. |
int |
keyline
The index of the horizontal keyline specified to the parent CoordinatorLayout that this
child should align relative to.
|
bottomMargin, DEFAULT_MARGIN_RELATIVE, leftMargin, rightMargin, topMargin
FILL_PARENT, height, layoutAnimationParameters, MATCH_PARENT, width, WRAP_CONTENT
Constructor and Description |
---|
LayoutParams(CoordinatorLayout.LayoutParams p) |
LayoutParams(int width,
int height) |
LayoutParams(ViewGroup.LayoutParams p) |
LayoutParams(ViewGroup.MarginLayoutParams p) |
Modifier and Type | Method and Description |
---|---|
int |
getAnchorId()
Get the id of this view's anchor.
|
CoordinatorLayout.Behavior |
getBehavior()
Get the behavior governing the layout and interaction of the child view within
a parent CoordinatorLayout.
|
void |
setAnchorId(int id)
Set the id of this view's anchor.
|
void |
setBehavior(CoordinatorLayout.Behavior behavior)
Set the behavior governing the layout and interaction of the child view within
a parent CoordinatorLayout.
|
copyMarginsFrom, encodeProperties, getLayoutDirection, getMarginEnd, getMarginStart, isLayoutRtl, isMarginRelative, onDebugDraw, resolveLayoutDirection, setLayoutDirection, setMarginEnd, setMargins, setMarginsRelative, setMarginStart
debug, setBaseAttributes, sizeToString
public int gravity
public int anchorGravity
public int keyline
anchor
is present the
keyline will be ignored.public int insetEdge
Gravity
value describing how this child view insets the CoordinatorLayout.
Other child views which are set to dodge the same inset edges will be moved appropriately
so that the views do not overlap.public int dodgeInsetEdges
Gravity
value describing how this child view dodges any inset child views in
the CoordinatorLayout. Any views which are inset on the same edge as this view is set to
dodge will result in this view being moved so that the views do not overlap.public LayoutParams(int width, int height)
public LayoutParams(CoordinatorLayout.LayoutParams p)
public LayoutParams(ViewGroup.MarginLayoutParams p)
public LayoutParams(ViewGroup.LayoutParams p)
@IdRes public int getAnchorId()
view id
or View.NO_ID
if there is no anchorpublic void setAnchorId(@IdRes int id)
The view with this id must be a descendant of the CoordinatorLayout containing the child view this LayoutParams belongs to. It may not be the child view with this LayoutParams or a descendant of it.
id
- The view id
of the anchor or
View.NO_ID
if there is no anchor@Nullable public CoordinatorLayout.Behavior getBehavior()
public void setBehavior(@Nullable CoordinatorLayout.Behavior behavior)
Setting a new behavior will remove any currently associated
Behavior tag
.
behavior
- The behavior to set or null for no special behavior