added in version 26.1.0
belongs to Maven artifact


public class BoxInsetLayout
extends ViewGroup

   ↳ android.view.View
     ↳ android.view.ViewGroup

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.


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