added in version 24.1.0
belongs to Maven artifact com.android.support:coordinatorlayout:28.0.0-alpha1

CoordinatorLayout.LayoutParams

public static class CoordinatorLayout.LayoutParams
extends ViewGroup.MarginLayoutParams

java.lang.Object
   ↳ android.view.ViewGroup.LayoutParams
     ↳ android.view.ViewGroup.MarginLayoutParams
       ↳ android.support.design.widget.CoordinatorLayout.LayoutParams


Parameters describing the desired layout for a child of a CoordinatorLayout.

Summary

Inherited constants

From class android.view.ViewGroup.LayoutParams

Fields

public int anchorGravity

A Gravity value describing which edge of a child view's anchor view the child should position itself relative to.

public int dodgeInsetEdges

A Gravity value describing how this child view dodges any inset child views in the CoordinatorLayout.

public int gravity

A Gravity value describing how this child view should lay out.

public int insetEdge

A Gravity value describing how this child view insets the CoordinatorLayout.

public int keyline

The index of the horizontal keyline specified to the parent CoordinatorLayout that this child should align relative to.

Inherited fields

From class android.view.ViewGroup.MarginLayoutParams
From class android.view.ViewGroup.LayoutParams

Public constructors

CoordinatorLayout.LayoutParams(int width, int height)
CoordinatorLayout.LayoutParams(CoordinatorLayout.LayoutParams p)
CoordinatorLayout.LayoutParams(ViewGroup.MarginLayoutParams p)
CoordinatorLayout.LayoutParams(ViewGroup.LayoutParams p)

Public methods

int getAnchorId()

Get the id of this view's anchor.

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(Behavior behavior)

Set the behavior governing the layout and interaction of the child view within a parent CoordinatorLayout.

Inherited methods

From class android.view.ViewGroup.MarginLayoutParams
From class android.view.ViewGroup.LayoutParams
From class java.lang.Object

Fields

anchorGravity

added in version 24.1.0
int anchorGravity

A Gravity value describing which edge of a child view's anchor view the child should position itself relative to.

dodgeInsetEdges

added in version 25.1.0
int dodgeInsetEdges

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

added in version 24.1.0
int gravity

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 TOP or START. If an anchor is also specified, the gravity describes how this child view should be positioned relative to its anchored position.

insetEdge

added in version 25.1.0
int insetEdge

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.

keyline

added in version 24.1.0
int keyline

The index of the horizontal keyline specified to the parent CoordinatorLayout that this child should align relative to. If an anchor is present the keyline will be ignored.

Public constructors

CoordinatorLayout.LayoutParams

added in version 24.1.0
CoordinatorLayout.LayoutParams (int width, 
                int height)

Parameters
width int

height int

CoordinatorLayout.LayoutParams

added in version 24.1.0
CoordinatorLayout.LayoutParams (CoordinatorLayout.LayoutParams p)

Parameters
p CoordinatorLayout.LayoutParams

CoordinatorLayout.LayoutParams

added in version 24.1.0
CoordinatorLayout.LayoutParams (ViewGroup.MarginLayoutParams p)

Parameters
p ViewGroup.MarginLayoutParams

CoordinatorLayout.LayoutParams

added in version 24.1.0
CoordinatorLayout.LayoutParams (ViewGroup.LayoutParams p)

Parameters
p ViewGroup.LayoutParams

Public methods

getAnchorId

added in version 24.1.0
int getAnchorId ()

Get the id of this view's anchor.

Returns
int A view id or NO_ID if there is no anchor

getBehavior

added in version 24.1.0
Behavior getBehavior ()

Get the behavior governing the layout and interaction of the child view within a parent CoordinatorLayout.

Returns
Behavior The current behavior or null if no behavior is specified

setAnchorId

added in version 24.1.0
void setAnchorId (int id)

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 NO_ID if there is no anchor

setBehavior

added in version 24.1.0
void setBehavior (Behavior behavior)

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 Behavior: The behavior to set or null for no special behavior