BoxInsetLayout
@UiThread
class BoxInsetLayout : ViewGroup
BoxInsetLayout is a screen shape-aware ViewGroup that can box its children in the center square of a round screen by using the layout_boxedEdges attribute. The values for this attribute specify the child's edges to be boxed in: left|top|right|bottom or all. The layout_boxedEdges attribute is ignored on a device with a rectangular screen.
Summary
Nested types |
|---|
|
Per-child layout information for layouts that support margins, gravity and boxedEdges. |
Public constructors |
|---|
BoxInsetLayout(context: Context)Simple constructor to use when creating a view from code. |
BoxInsetLayout(context: Context, attrs: AttributeSet?)Constructor that is called when inflating a view from XML. |
BoxInsetLayout(Perform inflation from XML and apply a class-specific base style from a theme attribute. |
Public functions |
|
|---|---|
BoxInsetLayout.LayoutParams! |
generateLayoutParams(attrs: AttributeSet!) |
Unit |
setForeground(drawable: Drawable!) |
Protected functions |
|
|---|---|
Boolean |
|
ViewGroup.LayoutParams! |
|
Unit |
|
Unit |
|
Unit |
Inherited Constants |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Public constructors
BoxInsetLayout
BoxInsetLayout(context: Context)
Simple constructor to use when creating a view from code.
BoxInsetLayout
BoxInsetLayout(context: Context, attrs: AttributeSet?)
Constructor that is called when inflating a view from XML. This is called when a view is being constructed from an XML file, supplying attributes that were specified in the XML file. This version uses a default style of 0, so the only attribute values applied are those in the Context's Theme and the given AttributeSet.
The method onFinishInflate() will be called after all children have been added.
| Parameters | |
|---|---|
context: Context |
The |
attrs: AttributeSet? |
The attributes of the XML tag that is inflating the view. |
BoxInsetLayout
BoxInsetLayout(
context: Context,
attrs: AttributeSet?,
defStyle: @StyleRes Int
)
Perform inflation from XML and apply a class-specific base style from a theme attribute. This constructor allows subclasses to use their own base style when they are inflating.
| Parameters | |
|---|---|
context: Context |
The |
attrs: AttributeSet? |
The attributes of the XML tag that is inflating the view. |
defStyle: @StyleRes Int |
An attribute in the current theme that contains a reference to a style resource that supplies default values for the view. Can be 0 to not look for defaults. |
Public functions
generateLayoutParams
fun generateLayoutParams(attrs: AttributeSet!): BoxInsetLayout.LayoutParams!
Protected functions
generateLayoutParams
protected fun generateLayoutParams(p: ViewGroup.LayoutParams!): ViewGroup.LayoutParams!