android.support.wearable.view
Class BoxInsetLayout
java.lang.Object
FrameLayout
android.support.wearable.view.BoxInsetLayout
public class BoxInsetLayout
- extends FrameLayout
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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BoxInsetLayout
public BoxInsetLayout(Context context)
BoxInsetLayout
public BoxInsetLayout(Context context,
AttributeSet attrs)
BoxInsetLayout
public BoxInsetLayout(Context context,
AttributeSet attrs,
int defStyle)
onAttachedToWindow
protected void onAttachedToWindow()
onApplyWindowInsets
public WindowInsets onApplyWindowInsets(WindowInsets insets)
isRound
public boolean isRound()
- determine screen shape
- Returns:
- true if on a round screen
getInsets
public Rect getInsets()
- Returns:
- the system window insets Rect
onMeasure
protected void onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
onLayout
protected void onLayout(boolean changed,
int left,
int top,
int right,
int bottom)
setForeground
public void setForeground(Drawable drawable)
checkLayoutParams
protected boolean checkLayoutParams(ViewGroup.LayoutParams p)
generateLayoutParams
protected ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams p)
generateLayoutParams
public BoxInsetLayout.LayoutParams generateLayoutParams(AttributeSet attrs)