LayoutParams

constructor(@NonNull context: Context, @Nullable attrs: AttributeSet)

Creates a new set of layout parameters. The values are extracted from the supplied attributes set and context.

Parameters

context

the application environment

attrs

the set of attributes from which to extract the layout parameters' values


constructor(width: Int, height: Int)
constructor(width: Int, height: Int, weight: Float)
constructor(@NonNull source: ViewGroup.MarginLayoutParams)
constructor(@NonNull source: LinearLayout.LayoutParams)


constructor(width: Int, height: Int, weight: Float, @Nullable overflowIcon: Drawable, @Nullable overflowText: CharSequence)

Creates a new set of layout parameters with the specified width, height, weight, overflow icon and overflow text.

Parameters

width

the width, either MATCH_PARENT, WRAP_CONTENT or a fixed size in pixels

height

the height, either MATCH_PARENT, WRAP_CONTENT or a fixed size in pixels

weight

the weight

overflowIcon

the overflow icon drawable

overflowText

the overflow text char sequence


Copy constructor. Clones the values of the source.

Parameters

source

The layout params to copy from.