BoxInsetLayout
@UiThread open class BoxInsetLayout : ViewGroup
kotlin.Any | |||
↳ | android.view.View | ||
↳ | android.view.ViewGroup | ||
↳ | androidx.wear.widget.BoxInsetLayout |
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 classes | |
---|---|
open |
Per-child layout information for layouts that support margins, gravity and boxedEdges. |
Public constructors | |
---|---|
Simple constructor to use when creating a view from code. |
|
<init>(@NonNull context: Context, @Nullable attrs: AttributeSet?) Constructor that is called when inflating a view from XML. |
|
<init>(@NonNull context: Context, @Nullable attrs: AttributeSet?, @StyleRes defStyle: Int) Perform inflation from XML and apply a class-specific base style from a theme attribute. |
Public methods | |
---|---|
open BoxInsetLayout.LayoutParams! |
generateLayoutParams(attrs: AttributeSet!) |
open Unit |
setForeground(drawable: Drawable!) |
Protected methods | |
---|---|
open Boolean | |
open LayoutParams! | |
open Unit | |
open Unit | |
open Unit |
Public constructors
<init>
BoxInsetLayout(@NonNull context: Context)
Simple constructor to use when creating a view from code.
Parameters | |
---|---|
context |
Context: The Context the view is running in, through which it can access the current theme, resources, etc. |
<init>
BoxInsetLayout(
@NonNull context: Context,
@Nullable 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 Context the view is running in, through which it can access the current theme, resources, etc. |
attrs |
AttributeSet?: The attributes of the XML tag that is inflating the view. |
<init>
BoxInsetLayout(
@NonNull context: Context,
@Nullable attrs: AttributeSet?,
@StyleRes defStyle: 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 Context the view is running in, through which it can access the current theme, resources, etc. |
attrs |
AttributeSet?: The attributes of the XML tag that is inflating the view. |
defStyle |
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 methods
generateLayoutParams
open fun generateLayoutParams(attrs: AttributeSet!): BoxInsetLayout.LayoutParams!
Protected methods
checkLayoutParams
protected open fun checkLayoutParams