BoxInsetLayout

public class BoxInsetLayout
extends FrameLayout

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ android.support.wearable.view.BoxInsetLayout


This class is deprecated.
use the androidx.wear.widget.BoxInsetLayout provided by Jetpack Wear library instead.

BoxInsetLayout is a screen shape-aware FrameLayout that can box its children in the center square of a round screen by using the layout_box attribute. The values for this attribute specify the child's edges to be boxed in: left|top|right|bottom or all. The layout_box attribute is ignored on a device with a rectangular screen.

Summary

Nested classes

class BoxInsetLayout.LayoutParams

This class is deprecated. use the androidx.wear.widget.BoxInsetLayout provided by Jetpack Wear library instead.  

Inherited constants

Inherited fields

Public constructors

BoxInsetLayout(Context context)
BoxInsetLayout(Context context, AttributeSet attrs)
BoxInsetLayout(Context context, AttributeSet attrs, int defStyle)

Public methods

BoxInsetLayout.LayoutParams generateLayoutParams(AttributeSet attrs)
Rect getInsets()
boolean isRound()

Determine screen shape

WindowInsets onApplyWindowInsets(WindowInsets insets)
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

Public constructors

BoxInsetLayout

public BoxInsetLayout (Context context)

Parameters
context Context

BoxInsetLayout

public BoxInsetLayout (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

BoxInsetLayout

public BoxInsetLayout (Context context, 
                AttributeSet attrs, 
                int defStyle)

Parameters
context Context

attrs AttributeSet

defStyle int

Public methods

generateLayoutParams

public BoxInsetLayout.LayoutParams generateLayoutParams (AttributeSet attrs)

Parameters
attrs AttributeSet

Returns
BoxInsetLayout.LayoutParams

getInsets

public Rect getInsets ()

Returns
Rect the system window insets Rect

isRound

public boolean isRound ()

Determine screen shape

Returns
boolean true if on a round screen

onApplyWindowInsets

public WindowInsets onApplyWindowInsets (WindowInsets insets)

Parameters
insets WindowInsets

Returns
WindowInsets

setForeground

public void setForeground (Drawable drawable)

Parameters
drawable Drawable

Protected methods

checkLayoutParams

protected boolean checkLayoutParams (ViewGroup.LayoutParams p)

Parameters
p ViewGroup.LayoutParams

Returns
boolean

generateLayoutParams

protected ViewGroup.LayoutParams generateLayoutParams (ViewGroup.LayoutParams p)

Parameters
p ViewGroup.LayoutParams

Returns
ViewGroup.LayoutParams

onAttachedToWindow

protected void onAttachedToWindow ()

onLayout

protected void onLayout (boolean changed, 
                int left, 
                int top, 
                int right, 
                int bottom)

Parameters
changed boolean

left int

top int

right int

bottom int

onMeasure

protected void onMeasure (int widthMeasureSpec, 
                int heightMeasureSpec)

Parameters
widthMeasureSpec int

heightMeasureSpec int