generateLayoutParams

open fun generateLayoutParams(attrs: AttributeSet): LayoutParams

Returns a new set of layout parameters based on the supplied attributes set.

Return

an instance of android.view.ViewGroup.LayoutParams or one of its descendants

Parameters

attrs

the attributes to build the layout parameters from


protected open fun generateLayoutParams(p: LayoutParams): LayoutParams

Returns a safe set of layout parameters based on the supplied layout params. When a ViewGroup is passed a View whose layout params do not pass the test of checkLayoutParams, this method is invoked. This method should return a new set of layout params suitable for this ViewGroup, possibly by copying the appropriate attributes from the specified set of layout params.

Return

an instance of android.view.ViewGroup.LayoutParams or one of its descendants

Parameters

p

The layout parameters to convert into a suitable set of layout parameters for this ViewGroup.