Skip to content

Most visited

Recently visited

navigation

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 XML attributes

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

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

int anchorGravity

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

dodgeInsetEdges

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

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

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

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

CoordinatorLayout.LayoutParams (int width, 
                int height)

Parameters
width int
height int

CoordinatorLayout.LayoutParams

CoordinatorLayout.LayoutParams (CoordinatorLayout.LayoutParams p)

Parameters
p CoordinatorLayout.LayoutParams

CoordinatorLayout.LayoutParams

CoordinatorLayout.LayoutParams (ViewGroup.MarginLayoutParams p)

Parameters
p ViewGroup.MarginLayoutParams

CoordinatorLayout.LayoutParams

CoordinatorLayout.LayoutParams (ViewGroup.LayoutParams p)

Parameters
p ViewGroup.LayoutParams

Public methods

getAnchorId

int getAnchorId ()

Get the id of this view's anchor.

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

getBehavior

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

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

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
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.