Most visited

Recently visited

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 gravity

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

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.

gravity

int gravity

A Gravity value describing how this child view should lay out. If an anchor is also specified, the gravity describes how this child view should be positioned relative to its anchored position.

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

Hooray!