added in version 26.1.0
belongs to Maven artifact com.android.support:wear:28.0.0-alpha1

BoxInsetLayout

public class BoxInsetLayout
extends ViewGroup

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.support.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 boxedEdges attribute. The values for this attribute specify the child's edges to be boxed in: left|top|right|bottom or all. The boxedEdges attribute is ignored on a device with a rectangular screen.

Summary

Nested classes

class BoxInsetLayout.LayoutParams

Per-child layout information for layouts that support margins, gravity and boxedEdges. 

Inherited constants

From class android.view.ViewGroup
From class android.view.View

Inherited fields

From class android.view.View

Public constructors

BoxInsetLayout(Context context)

Simple constructor to use when creating a view from code.

BoxInsetLayout(Context context, AttributeSet attrs)

Constructor that is called when inflating a view from XML.

BoxInsetLayout(Context context, AttributeSet attrs, int defStyle)

Perform inflation from XML and apply a class-specific base style from a theme attribute.

Public methods

BoxInsetLayout.LayoutParams generateLayoutParams(AttributeSet attrs)
void setForeground(Drawable drawable)

Protected methods

boolean checkLayoutParams(ViewGroup.LayoutParams p)
ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams p)
void onAttachedToWindow()
void onLayout(boolean changed, int left, int top, int right, int bottom)
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)

Inherited methods

From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.view.ViewParent
From interface android.view.ViewManager
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource

Public constructors

BoxInsetLayout

added in version 26.1.0
BoxInsetLayout (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.

BoxInsetLayout

added in version 26.1.0
BoxInsetLayout (Context context, 
                AttributeSet attrs)

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.

BoxInsetLayout

added in version 26.1.0
BoxInsetLayout (Context context, 
                AttributeSet attrs, 
                int defStyle)

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

added in version 26.1.0
BoxInsetLayout.LayoutParams generateLayoutParams (AttributeSet attrs)

Parameters
attrs AttributeSet

Returns
BoxInsetLayout.LayoutParams

setForeground

void setForeground (Drawable drawable)

Parameters
drawable Drawable

Protected methods

checkLayoutParams

boolean checkLayoutParams (ViewGroup.LayoutParams p)

Parameters
p ViewGroup.LayoutParams

Returns
boolean

generateLayoutParams

ViewGroup.LayoutParams generateLayoutParams (ViewGroup.LayoutParams p)

Parameters
p ViewGroup.LayoutParams

Returns
ViewGroup.LayoutParams

onAttachedToWindow

void onAttachedToWindow ()

onLayout

added in version 26.1.0
void onLayout (boolean changed, 
                int left, 
                int top, 
                int right, 
                int bottom)

Parameters
changed boolean

left int

top int

right int

bottom int

onMeasure

void onMeasure (int widthMeasureSpec, 
                int heightMeasureSpec)

Parameters
widthMeasureSpec int

heightMeasureSpec int