public class

BoxInsetLayout

extends FrameLayout

Note: The Wearable Support Library classes under the android.support.wearable package are subject to change. For the full Android API reference, see Reference.

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

Class Overview

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 adds layout_box attribute to layout parameters  
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
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)
[Expand]
Inherited Methods
From class android.widget.FrameLayout
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

public BoxInsetLayout (Context context)

public BoxInsetLayout (Context context, AttributeSet attrs)

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

Public Methods

public BoxInsetLayout.LayoutParams generateLayoutParams (AttributeSet attrs)

public Rect getInsets ()

Returns
  • the system window insets Rect

public boolean isRound ()

determine screen shape

Returns
  • true if on a round screen

public WindowInsets onApplyWindowInsets (WindowInsets insets)

public void setForeground (Drawable drawable)

Protected Methods

protected boolean checkLayoutParams (ViewGroup.LayoutParams p)

protected ViewGroup.LayoutParams generateLayoutParams (ViewGroup.LayoutParams p)

protected void onAttachedToWindow ()

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

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)