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 Int |
Get 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 Unit |
setAnchorId(@IdRes id: Int) Set the id of this view's anchor. |
open Unit |
setBehavior(@Nullable behavior: CoordinatorLayout.Behavior<View!>?) Set the behavior governing the layout and interaction of the child view within a parent CoordinatorLayout. |
Properties | |
---|---|
Int |
A |
Int |
A |
Int |
A |
Int |
A |
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
getAnchorId
@IdRes 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 |
getBehavior
@Nullable 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 |
setAnchorId
open fun setAnchorId(@IdRes 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 |
setBehavior
open fun setBehavior(@Nullable 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 |
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.