public class

ActionPage

extends ViewGroup

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.support.wearable.view.ActionPage

Class Overview

Displays a circular button, with an optional image to perform an action. On round devices the button is centered within the page, and is slightly above center on square devices. An ActionLabel is included centered within the space between the bottom of the button and the bottom of the page, using up to two lines of text if necessary.

Summary

[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
Fields
public static int SCALE_MODE_CENTER
public static int SCALE_MODE_FIT
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
ActionPage(Context context)
ActionPage(Context context, AttributeSet attrs)
ActionPage(Context context, AttributeSet attrs, int defStyleAttr)
ActionPage(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
WindowInsets onApplyWindowInsets(WindowInsets insets)
void setColor(int color)
Sets the color of the circular button.
void setColor(ColorStateList color)
Sets the colors for the circular button.
void setEnabled(boolean enabled)
Set the enabled state of this view.
void setImageDrawable(Drawable drawable)
Sets an optional image to be displayed on top of the button.
void setImageResource(int drawableRes)
Sets an optional image to be displayed on top of the button.
void setImageScaleMode(int scaleMode)
Sets the scaling mode used for the optional image.
void setOnClickListener(View.OnClickListener l)
Register a callback to be invoked when the circular button is clicked.
void setStateListAnimator(StateListAnimator stateListAnimator)
Attaches the provided StateListAnimator to the circular button.
void setText(CharSequence text)
Sets the text of the action label.
Protected Methods
void onAttachedToWindow()
void onLayout(boolean changed, int l, int t, int r, int b)
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
[Expand]
Inherited Methods
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

Fields

public static int SCALE_MODE_CENTER

public static int SCALE_MODE_FIT

Public Constructors

public ActionPage (Context context)

public ActionPage (Context context, AttributeSet attrs)

public ActionPage (Context context, AttributeSet attrs, int defStyleAttr)

public ActionPage (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public Methods

public WindowInsets onApplyWindowInsets (WindowInsets insets)

public void setColor (int color)

Sets the color of the circular button.

public void setColor (ColorStateList color)

Sets the colors for the circular button.

public void setEnabled (boolean enabled)

Set the enabled state of this view. The interpretation of the enabled state varies by subclass.

Parameters
enabled True if this view is enabled, false otherwise.

public void setImageDrawable (Drawable drawable)

Sets an optional image to be displayed on top of the button.

public void setImageResource (int drawableRes)

Sets an optional image to be displayed on top of the button.

public void setImageScaleMode (int scaleMode)

Sets the scaling mode used for the optional image.

Must be one of:

SCALE_MODE_CENTER
Center the image within the button and draw without any scaling.
SCALE_MODE_FIT
Draw the image scaled to fit within the circular button.

public void setOnClickListener (View.OnClickListener l)

Register a callback to be invoked when the circular button is clicked. If it is not clickable, it becomes clickable.

Parameters
l The callback that will run

public void setStateListAnimator (StateListAnimator stateListAnimator)

Attaches the provided StateListAnimator to the circular button.

Any previously attached StateListAnimator will be detached.

Parameters
stateListAnimator The StateListAnimator to update the view

public void setText (CharSequence text)

Sets the text of the action label.

Protected Methods

protected void onAttachedToWindow ()

protected void onLayout (boolean changed, int l, int t, int r, int b)

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)