WatchViewStub

public class WatchViewStub
extends FrameLayout

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


This class is deprecated.
starting with API 23 the sdk supports "round" and "notround" configuration qualifiers which are preferred. For more information about configuration qualifiers, see https://developer.android.com/guide/topics/resources/providing-resources.html

A WatchViewStub allows for the use of different sub-layouts depending on the shape of the device screen as reported by onApplyWindowInsets. If the call is not delivered by initial measurement the container will be assumed rectangular.

Summary

Nested classes

interface WatchViewStub.OnLayoutInflatedListener

This interface is deprecated. starting with API 23 the sdk supports "round" and "notround" configuration qualifiers which are preferred. For more information about configuration qualifiers, see https://developer.android.com/guide/topics/resources/providing-resources.html  

Inherited constants

Inherited fields

Public constructors

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

Public methods

WindowInsets onApplyWindowInsets(WindowInsets insets)
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
void setOnLayoutInflatedListener(WatchViewStub.OnLayoutInflatedListener listener)

Set a listener to be notified when one of the specified sub-layouts is inflated into this stub container.

void setRectLayout(int resId)

Set a layout resource to be inflated when this stub is within a rectangular container.

void setRoundLayout(int resId)

Set a layout resource to be inflated when this stub is within a round container.

Protected methods

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

Inherited methods

Public constructors

WatchViewStub

public WatchViewStub (Context context)

Parameters
context Context

WatchViewStub

public WatchViewStub (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

WatchViewStub

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

Parameters
context Context

attrs AttributeSet

defStyle int

Public methods

onApplyWindowInsets

public WindowInsets onApplyWindowInsets (WindowInsets insets)

Parameters
insets WindowInsets

Returns
WindowInsets

onMeasure

public void onMeasure (int widthMeasureSpec, 
                int heightMeasureSpec)

Parameters
widthMeasureSpec int

heightMeasureSpec int

setOnLayoutInflatedListener

public void setOnLayoutInflatedListener (WatchViewStub.OnLayoutInflatedListener listener)

Set a listener to be notified when one of the specified sub-layouts is inflated into this stub container.

If your app needs to perform a series of findViewById lookups on the final inflated layout this callback is a great time to do so.

Parameters
listener WatchViewStub.OnLayoutInflatedListener: Listener to notify

setRectLayout

public void setRectLayout (int resId)

Set a layout resource to be inflated when this stub is within a rectangular container.

Parameters
resId int: Resource id of a child layout to inflate

setRoundLayout

public void setRoundLayout (int resId)

Set a layout resource to be inflated when this stub is within a round container.

Parameters
resId int: Resource id of a child layout to inflate

Protected methods

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