Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

ActionPage

public class ActionPage
extends ViewGroup

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.support.wearable.view.ActionPage


This class is deprecated.
with Android Wear 2.0 it is recommended to use the android.support.wear.widget.drawer.WearableActionDrawerView for navigation and the ConfirmationOverlay for confirmation actions in particular.

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

Constants

int SCALE_MODE_CENTER

int SCALE_MODE_FIT

Inherited constants

From class android.view.ViewGroup
From class android.view.View

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(ColorStateList color)

Sets the colors for the circular button.

void setColor(int color)

Sets the color of 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)

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

Constants

SCALE_MODE_CENTER

int SCALE_MODE_CENTER

Constant Value: 1 (0x00000001)

SCALE_MODE_FIT

int SCALE_MODE_FIT

Constant Value: 0 (0x00000000)

Public constructors

ActionPage

ActionPage (Context context)

Parameters
context Context

ActionPage

ActionPage (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

ActionPage

ActionPage (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)

Parameters
context Context

attrs AttributeSet

defStyleAttr int

ActionPage

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

Parameters
context Context

attrs AttributeSet

defStyleAttr int

defStyleRes int

Public methods

onApplyWindowInsets

WindowInsets onApplyWindowInsets (WindowInsets insets)

Parameters
insets WindowInsets

Returns
WindowInsets

setColor

void setColor (ColorStateList color)

Sets the colors for the circular button.

Parameters
color ColorStateList

setColor

void setColor (int color)

Sets the color of the circular button.

Parameters
color int

setEnabled

void setEnabled (boolean enabled)

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

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

setImageDrawable

void setImageDrawable (Drawable drawable)

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

Parameters
drawable Drawable

setImageResource

void setImageResource (int drawableRes)

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

Parameters
drawableRes int

setImageScaleMode

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.

Parameters
scaleMode int

setOnClickListener

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 View.OnClickListener: The callback that will run

setStateListAnimator

void setStateListAnimator (StateListAnimator stateListAnimator)

Attaches the provided StateListAnimator to the circular button.

Any previously attached StateListAnimator will be detached.

Parameters
stateListAnimator StateListAnimator: The StateListAnimator to update the view

See also:

setText

void setText (CharSequence text)

Sets the text of the action label.

Parameters
text CharSequence

Protected methods

onAttachedToWindow

void onAttachedToWindow ()

onLayout

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

Parameters
changed boolean

l int

t int

r int

b int

onMeasure

void onMeasure (int widthMeasureSpec, 
                int heightMeasureSpec)

Parameters
widthMeasureSpec int

heightMeasureSpec int