Package icyllis.modernui.widget

# Class CoordinatorLayout.LayoutParams

java.lang.Object
icyllis.modernui.view.ViewGroup.LayoutParams
icyllis.modernui.view.ViewGroup.MarginLayoutParams
icyllis.modernui.widget.CoordinatorLayout.LayoutParams

Enclosing class:
  `CoordinatorLayout`

public static class CoordinatorLayout.LayoutParams extends ViewGroup.MarginLayoutParams
Parameters describing the desired layout for a child of a `CoordinatorLayout`.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `int`
  `anchorGravity`
  A `Gravity` value describing which edge of a child view's `anchor` view the child should position itself relative to.
  `int`
  `dodgeInsetEdges`
  A `Gravity` value describing how this child view dodges any inset child views in the CoordinatorLayout.
  `int`
  `gravity`
  A `Gravity` value describing how this child view should lay out.
  `int`
  `insetEdge`
  A `Gravity` value describing how this child view insets the CoordinatorLayout.

  ### Fields inherited from class icyllis.modernui.view.ViewGroup.MarginLayoutParams

  `bottomMargin, DEFAULT_MARGIN_RELATIVE, leftMargin, rightMargin, topMargin`

  ### Fields inherited from class icyllis.modernui.view.ViewGroup.LayoutParams

  `height, MATCH_PARENT, width, WRAP_CONTENT`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LayoutParams(int width, int height)`
  `LayoutParams(ViewGroup.LayoutParams p)`
  `LayoutParams(ViewGroup.MarginLayoutParams p)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getAnchorId()`
  Get the id of this view's anchor.
  `<V extends View>
  CoordinatorLayout.Behavior<V>`
  `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(CoordinatorLayout.Behavior<?> behavior)`
  Set the behavior governing the layout and interaction of the child view within a parent CoordinatorLayout.

  ### Methods inherited from class icyllis.modernui.view.ViewGroup.MarginLayoutParams

  `copyMarginsFrom, getLayoutDirection, getMarginEnd, getMarginStart, isLayoutRtl, isMarginRelative, onDebugDraw, resolveLayoutDirection, setLayoutDirection, setMarginEnd, setMargins, setMarginsRelative, setMarginStart`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### gravity

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

  - ### anchorGravity

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

  - ### insetEdge

    public 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.

  - ### dodgeInsetEdges

    public 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.

- ## Constructor Details

  - ### LayoutParams

    public LayoutParams(int width, int height)

  - ### LayoutParams

    public LayoutParams(ViewGroup.MarginLayoutParams p)

  - ### LayoutParams

    public LayoutParams(ViewGroup.LayoutParams p)

- ## Method Details

  - ### getAnchorId

    public int getAnchorId()
    Get the id of this view's anchor.
    Returns:
      A `view id` or `View.NO_ID` if there is no anchor

  - ### setAnchorId

    public 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` - The `view id` of the anchor or `View.NO_ID` if there is no anchor

  - ### getBehavior

    @Nullable public <V extends View> CoordinatorLayout.Behavior<V> getBehavior()
    Get the behavior governing the layout and interaction of the child view within a parent CoordinatorLayout.
    Returns:
      The current behavior or null if no behavior is specified

  - ### setBehavior

    public void setBehavior(@Nullable CoordinatorLayout.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` - The behavior to set or null for no special behavior