Class ViewGroup.LayoutParams

java.lang.Object
icyllis.modernui.view.ViewGroup.LayoutParams
Direct Known Subclasses:
AbsListView.LayoutParams, AbsoluteLayout.LayoutParams, ViewGroup.MarginLayoutParams, ViewPager.LayoutParams, WindowManager.LayoutParams
Enclosing class:
ViewGroup

public static class ViewGroup.LayoutParams extends Object
LayoutParams are used by views to tell their parents how they want to be laid out.

The base LayoutParams class just describes how big the view wants to be for both width and height.

There are subclasses of LayoutParams for different subclasses of ViewGroup.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    Information about how tall the view wants to be.
    static final int
    Special value for the height or width requested by a View.
    int
    Information about how wide the view wants to be.
    static final int
    Special value for the height or width requested by a View.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LayoutParams(int width, int height)
    Creates a new set of layout parameters with the specified width and height.
    Copy constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    resolveLayoutDirection(int layoutDirection)
    Resolve layout parameters depending on the layout direction.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MATCH_PARENT

      public static final int MATCH_PARENT
      Special value for the height or width requested by a View. MATCH_PARENT means that the view wants to be as big as its parent, minus the parent's padding, if any. Introduced in API Level 8.
      See Also:
    • WRAP_CONTENT

      public static final int WRAP_CONTENT
      Special value for the height or width requested by a View. WRAP_CONTENT means that the view wants to be just large enough to fit its own internal content, taking its own padding into account.
      See Also:
    • width

      public int width
      Information about how wide the view wants to be. Can be one of the constants MATCH_PARENT or WRAP_CONTENT, or an exact size.
    • height

      public int height
      Information about how tall the view wants to be. Can be one of the constants MATCH_PARENT or WRAP_CONTENT, or an exact size.
  • Constructor Details

    • LayoutParams

      public LayoutParams(int width, int height)
      Creates a new set of layout parameters with the specified width and height.
      Parameters:
      width - the width, either WRAP_CONTENT, MATCH_PARENT, or a size in pixels
      height - the height, either WRAP_CONTENT, MATCH_PARENT, or a size in pixels
    • LayoutParams

      public LayoutParams(@NonNull ViewGroup.LayoutParams source)
      Copy constructor. Clones the width and height values of the source.
      Parameters:
      source - the layout params to copy from.
  • Method Details

    • resolveLayoutDirection

      public void resolveLayoutDirection(int layoutDirection)
      Resolve layout parameters depending on the layout direction. Subclasses that care about layoutDirection changes should override this method. The default implementation does nothing.
      Parameters:
      layoutDirection - the direction of the layout
      See Also: