LayoutParams
open class LayoutParams : MarginLayoutParams
kotlin.Any | |||
↳ | android.view.ViewGroup.LayoutParams | ||
↳ | android.view.ViewGroup.MarginLayoutParams | ||
↳ | androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams |
Parameters describing the desired layout for a child of a CoordinatorLayout
.
Summary
Public constructors | |
---|---|
<init>(p: MarginLayoutParams!) |
|
<init>(p: LayoutParams!) |
Public methods | |
---|---|
open Unit |
setBehavior(behavior: CoordinatorLayout.Behavior<View!>?) Set the behavior governing the layout and interaction of the child view within a parent CoordinatorLayout. |
open Unit |
setAnchorId(id: Int) Set the id of this view's anchor. |
open CoordinatorLayout.Behavior<View!>? |
Get the behavior governing the layout and interaction of the child view within a parent CoordinatorLayout. |
open Int |
Get the id of this view's anchor. |
Properties | |
---|---|
Int |
A Gravity value describing which edge of a child view's |
Int |
A Gravity value describing how this child view dodges any inset child views in the CoordinatorLayout. |
Int |
A Gravity value describing how this child view should lay out. |
Int |
A Gravity value describing how this child view insets the CoordinatorLayout. |
Int |
The index of the horizontal keyline specified to the parent CoordinatorLayout that this child should align relative to. |
Public constructors
<init>
LayoutParams(p: CoordinatorLayout.LayoutParams!)
<init>
LayoutParams(p: MarginLayoutParams!)
<init>
LayoutParams(p: LayoutParams!)
Public methods
setBehavior
open fun setBehavior(behavior: CoordinatorLayout.Behavior<View!>?): Unit
Set the behavior governing the layout and interaction of the child view within a parent CoordinatorLayout.
Setting a new behavior will remove any currently associated Behavior tag
.
Parameters | |
---|---|
behavior |
CoordinatorLayout.Behavior<View!>?: The behavior to set or null for no special behavior |
setAnchorId
open fun setAnchorId(id: Int): Unit
Set the id of this view's anchor.
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.
Parameters | |
---|---|
id |
Int: The view id of the anchor or View#NO_ID if there is no anchor |
getBehavior
open fun getBehavior(): CoordinatorLayout.Behavior<View!>?
Get the behavior governing the layout and interaction of the child view within a parent CoordinatorLayout.
Return | |
---|---|
CoordinatorLayout.Behavior<View!>?: The current behavior or null if no behavior is specified |
getAnchorId
open fun getAnchorId(): Int
Get the id of this view's anchor.
Return | |
---|---|
Int: A view id or View#NO_ID if there is no anchor |
Properties
anchorGravity
var anchorGravity: Int
A Gravity value describing which edge of a child view's anchor
view the child should position itself relative to.
dodgeInsetEdges
var dodgeInsetEdges: Int
A 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.
gravity
var gravity: Int
A Gravity value describing how this child view should lay out. If either or both of the axes are not specified, they are treated by CoordinatorLayout as Gravity#TOP or GravityCompat#START. If an anchor
is also specified, the gravity describes how this child view should be positioned relative to its anchored position.
insetEdge
var insetEdge: Int
A 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.