WatchFaceStyle.Builder

public static class WatchFaceStyle.Builder
extends Object

java.lang.Object
   ↳ android.support.wearable.watchface.WatchFaceStyle.Builder


WatchFaceStyle对象的生成器。

Summary

Public constructors

WatchFaceStyle.Builder(Service service)

Public methods

WatchFaceStyle build()

构造只读WatchFaceStyle对象。

WatchFaceStyle.Builder setAcceptsTapEvents(boolean acceptsTapEvents)

设置此表盘是否接受轻击事件。

WatchFaceStyle.Builder setAmbientPeekMode(int ambientPeekMode)

设置在手表处于环境,黑白模式时如何显示第一张偷看卡。

WatchFaceStyle.Builder setBackgroundVisibility(int backgroundVisibility)

设置如何显示第一张偷看卡片的背景。

WatchFaceStyle.Builder setCardPeekMode(int peekMode)

在显示表盘时,设置第一张卡片在屏幕上的距离。

WatchFaceStyle.Builder setHotwordIndicatorGravity(int hotwordIndicatorGravity)

设置热门词汇(OK Google)在屏幕上的位置。

WatchFaceStyle.Builder setPeekOpacityMode(int peekOpacityMode)

设置显示表盘时,第一张偷看卡应该是不透明的。

WatchFaceStyle.Builder setShowSystemUiTime(boolean showSystemUiTime)

设置系统是否在系统表面绘制系统风格的时间。

WatchFaceStyle.Builder setShowUnreadCountIndicator(boolean show)

设置是否添加流中有多少个未读卡的指示符。

WatchFaceStyle.Builder setStatusBarGravity(int statusBarGravity)

在屏幕上设置状态图标的位置(电池状态,缺乏连接)。

WatchFaceStyle.Builder setViewProtection(int viewProtection)

此方法已弃用。 改为使用setViewProtectionMode(int)

WatchFaceStyle.Builder setViewProtectionMode(int viewProtectionMode)

将背景颜色添加到主屏幕的UI元素,以便在表盘上可读。

Inherited methods

From class java.lang.Object

Public constructors

WatchFaceStyle.Builder

WatchFaceStyle.Builder (Service service)

Parameters
service Service

Public methods

build

WatchFaceStyle build ()

构造只读WatchFaceStyle对象。

Returns
WatchFaceStyle

setAcceptsTapEvents

WatchFaceStyle.Builder setAcceptsTapEvents (boolean acceptsTapEvents)

设置此表盘是否接受轻击事件。 默认值是false。

该设置这Watchfaces true正指示它们准备接收 TAP_TYPE_TOUCHTAP_TYPE_TOUCH_CANCEL ,和 TAP_TYPE_TAP

Parameters
acceptsTapEvents boolean: whether to receive touch events.
Returns
WatchFaceStyle.Builder

setAmbientPeekMode

WatchFaceStyle.Builder setAmbientPeekMode (int ambientPeekMode)

设置在手表处于环境,黑白模式时如何显示第一张偷看卡。

Parameters
ambientPeekMode int: must be either AMBIENT_PEEK_MODE_VISIBLE or AMBIENT_PEEK_MODE_HIDDEN
Returns
WatchFaceStyle.Builder

setBackgroundVisibility

WatchFaceStyle.Builder setBackgroundVisibility (int backgroundVisibility)

设置如何显示第一张偷看卡片的背景。

Parameters
backgroundVisibility int: must be either BACKGROUND_VISIBILITY_INTERRUPTIVE or BACKGROUND_VISIBILITY_PERSISTENT
Returns
WatchFaceStyle.Builder

setCardPeekMode

WatchFaceStyle.Builder setCardPeekMode (int peekMode)

在显示表盘时,设置第一张卡片在屏幕上的距离。

Parameters
peekMode int: must be either PEEK_MODE_VARIABLE or PEEK_MODE_SHORT
Returns
WatchFaceStyle.Builder

setHotwordIndicatorGravity

WatchFaceStyle.Builder setHotwordIndicatorGravity (int hotwordIndicatorGravity)

设置热门词汇(OK Google)在屏幕上的位置。

Parameters
hotwordIndicatorGravity int: This must be any combination of horizontal Gravity constant (LEFT, CENTER_HORIZONTAL, RIGHT) and vertical Gravity constants (TOP, CENTER_VERTICAL, BOTTOM), e.g. Gravity.LEFT | Gravity.BOTTOM. On circular screens, only the vertical gravity is respected.
Returns
WatchFaceStyle.Builder

setPeekOpacityMode

WatchFaceStyle.Builder setPeekOpacityMode (int peekOpacityMode)

设置显示表盘时,第一张偷看卡应该是不透明的。

Parameters
peekOpacityMode int: must be either PEEK_OPACITY_MODE_OPAQUE or PEEK_OPACITY_MODE_TRANSLUCENT
Returns
WatchFaceStyle.Builder

setShowSystemUiTime

WatchFaceStyle.Builder setShowSystemUiTime (boolean showSystemUiTime)

设置系统是否在系统表面绘制系统风格的时间。

Parameters
showSystemUiTime boolean: Set this to false if you already draw or clearly represent the time on your watch face.
Returns
WatchFaceStyle.Builder

setShowUnreadCountIndicator

WatchFaceStyle.Builder setShowUnreadCountIndicator (boolean show)

设置是否添加流中有多少个未读卡的指示符。 指示器将显示在状态图标旁边(电池状态,缺少连接)。

Parameters
show boolean: if true an indicator will be shown
Returns
WatchFaceStyle.Builder

setStatusBarGravity

WatchFaceStyle.Builder setStatusBarGravity (int statusBarGravity)

在屏幕上设置状态图标的位置(电池状态,缺乏连接)。

Parameters
statusBarGravity int: This must be any combination of horizontal Gravity constant (LEFT, CENTER_HORIZONTAL, RIGHT) and vertical Gravity constants (TOP, CENTER_VERTICAL, BOTTOM), e.g. Gravity.LEFT | Gravity.BOTTOM. On circular screens, only the vertical gravity is respected.
Returns
WatchFaceStyle.Builder

setViewProtection

WatchFaceStyle.Builder setViewProtection (int viewProtection)

此方法已弃用。
改为使用setViewProtectionMode(int)

将背景颜色添加到主屏幕的UI元素,以便在表盘上可读。 如果表面颜色接近白色,应使用此项。

Parameters
viewProtection int: must be any combination of PROTECT_STATUS_BAR, PROTECT_HOTWORD_INDICATOR and PROTECT_WHOLE_SCREEN, e.g. PROTECT_STATUS_BAR | PROTECT_HOTWORD_INDICATOR
Returns
WatchFaceStyle.Builder

setViewProtectionMode

WatchFaceStyle.Builder setViewProtectionMode (int viewProtectionMode)

将背景颜色添加到主屏幕的UI元素,以便在表盘上可读。 如果表面颜色接近白色,应使用此项。

Parameters
viewProtectionMode int: must be any combination of PROTECT_STATUS_BAR, PROTECT_HOTWORD_INDICATOR and PROTECT_WHOLE_SCREEN, e.g. PROTECT_STATUS_BAR | PROTECT_HOTWORD_INDICATOR
Returns
WatchFaceStyle.Builder