ActionPage

public class ActionPage
extends ViewGroup

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


显示一个圆形按钮,带有可选图像以执行操作。 在圆形设备上,按钮位于页面的中心,略高于方形设备的中心。 ActionLabel包含在按钮底部和页面底部之间的空间中,如果需要,最多可以使用两行文本。

也可以看看:

Summary

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

Inherited fields

From class android.view.ViewGroup
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)

设置圆形按钮的颜色。

void setColor(int color)

设置圆形按钮的颜色。

void setEnabled(boolean enabled)

设置此视图的启用状态。

void setImageDrawable(Drawable drawable)

设置可选图像以显示在按钮上方。

void setImageResource(int drawableRes)

设置可选图像以显示在按钮上方。

void setImageScaleMode(int scaleMode)

设置用于可选图像的缩放模式。

void setOnClickListener(View.OnClickListener l)

当点击圆形按钮时注册要调用的回调。

void setStateListAnimator(StateListAnimator stateListAnimator)

将提供的StateListAnimator附加到圆形按钮上。

void setText(CharSequence text)

设置动作标签的文本。

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

Fields

SCALE_MODE_CENTER

int SCALE_MODE_CENTER

SCALE_MODE_FIT

int SCALE_MODE_FIT

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)

设置圆形按钮的颜色。

Parameters
color ColorStateList

setColor

void setColor (int color)

设置圆形按钮的颜色。

Parameters
color int

setEnabled

void setEnabled (boolean enabled)

设置此视图的启用状态。 启用状态的解释因子而异。

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

setImageDrawable

void setImageDrawable (Drawable drawable)

设置可选图像以显示在按钮上方。

Parameters
drawable Drawable

setImageResource

void setImageResource (int drawableRes)

设置可选图像以显示在按钮上方。

Parameters
drawableRes int

setImageScaleMode

void setImageScaleMode (int scaleMode)

设置用于可选图像的缩放模式。

必须是以下之一:

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)

当点击圆形按钮时注册要调用的回调。 如果它不可点击,则可点击。

Parameters
l View.OnClickListener: The callback that will run

也可以看看:

setStateListAnimator

void setStateListAnimator (StateListAnimator stateListAnimator)

将提供的StateListAnimator附加到圆形按钮上。

任何以前连接的StateListAnimator都将被分离。

Parameters
stateListAnimator StateListAnimator: The StateListAnimator to update the view

也可以看看:

setText

void setText (CharSequence text)

设置动作标签的文本。

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