WatchFaceStyle.Builder
public
static
class
WatchFaceStyle.Builder
extends Object
java.lang.Object | |
↳ | android.support.wearable.watchface.WatchFaceStyle.Builder |
Builder for WatchFaceStyle objects.
Summary
Public constructors | |
---|---|
WatchFaceStyle.Builder(Service service)
|
Public methods | |
---|---|
WatchFaceStyle
|
build()
Constructs read only WatchFaceStyle object. |
WatchFaceStyle.Builder
|
setAccentColor(int color)
Sets the accent color which can be set by developers to customise watch face. |
WatchFaceStyle.Builder
|
setAcceptsTapEvents(boolean acceptsTapEvents)
Sets whether this watchface accepts tap events. |
WatchFaceStyle.Builder
|
setAmbientPeekMode(int ambientPeekMode)
This method is deprecated. Wear 2.0 doesn't have peeking cards |
WatchFaceStyle.Builder
|
setBackgroundVisibility(int backgroundVisibility)
This method is deprecated. Wear 2.0 doesn't have peeking cards |
WatchFaceStyle.Builder
|
setCardPeekMode(int peekMode)
This method is deprecated. Wear 2.0 doesn't have peeking cards |
WatchFaceStyle.Builder
|
setHideNotificationIndicator(boolean hide)
Sets whether to hide the dot indicator that is displayed at the bottom of the watch face if there are any unread notifications. |
WatchFaceStyle.Builder
|
setHotwordIndicatorGravity(int hotwordIndicatorGravity)
This method is deprecated. Wear 2.0 doesn't show hotword indication on the watch face |
WatchFaceStyle.Builder
|
setPeekOpacityMode(int peekOpacityMode)
This method is deprecated. Wear 2.0 doesn't have peeking cards |
WatchFaceStyle.Builder
|
setShowSystemUiTime(boolean showSystemUiTime)
This method is deprecated. this will be removed in a future version of the Wear platform |
WatchFaceStyle.Builder
|
setShowUnreadCountIndicator(boolean show)
Sets whether to add an indicator of how many unread cards there are in the stream. |
WatchFaceStyle.Builder
|
setStatusBarGravity(int statusBarGravity)
Sets position of status icons (battery state, lack of connection) on the screen. |
WatchFaceStyle.Builder
|
setViewProtection(int viewProtection)
This method is deprecated.
Use |
WatchFaceStyle.Builder
|
setViewProtectionMode(int viewProtectionMode)
Adds background color to UI elements of the home screen, so they are readable on the watch face. |
Inherited methods | |
---|---|
![]()
java.lang.Object
|
Public constructors
Public methods
setAccentColor
WatchFaceStyle.Builder setAccentColor (int color)
Sets the accent color which can be set by developers to customise watch face. It will be used when drawing the unread notification indicator. Default color is white.
Parameters | |
---|---|
color |
int |
Returns | |
---|---|
WatchFaceStyle.Builder |
setAcceptsTapEvents
WatchFaceStyle.Builder setAcceptsTapEvents (boolean acceptsTapEvents)
Sets whether this watchface accepts tap events. The default is false.
Watchfaces that set this true
are indicating they are prepared to receive TAP_TYPE_TOUCH
, TAP_TYPE_TOUCH_CANCEL
, and TAP_TYPE_TAP
Parameters | |
---|---|
acceptsTapEvents |
boolean : whether to receive touch events.
|
Returns | |
---|---|
WatchFaceStyle.Builder |
setAmbientPeekMode
WatchFaceStyle.Builder setAmbientPeekMode (int ambientPeekMode)
This method is deprecated.
Wear 2.0 doesn't have peeking cards
Sets how the first, peeking card will be displayed while the watch is in ambient, black & white mode.
Parameters | |
---|---|
ambientPeekMode |
int : must be either AMBIENT_PEEK_MODE_VISIBLE or AMBIENT_PEEK_MODE_HIDDEN |
Returns | |
---|---|
WatchFaceStyle.Builder |
setBackgroundVisibility
WatchFaceStyle.Builder setBackgroundVisibility (int backgroundVisibility)
This method is deprecated.
Wear 2.0 doesn't have peeking cards
Set how to display background of the first, peeking card.
Parameters | |
---|---|
backgroundVisibility |
int : must be either BACKGROUND_VISIBILITY_INTERRUPTIVE or
BACKGROUND_VISIBILITY_PERSISTENT |
Returns | |
---|---|
WatchFaceStyle.Builder |
setCardPeekMode
WatchFaceStyle.Builder setCardPeekMode (int peekMode)
This method is deprecated.
Wear 2.0 doesn't have peeking cards
Sets how far into the screen the first card will peek while the watch face is displayed.
Parameters | |
---|---|
peekMode |
int : must be either PEEK_MODE_VARIABLE or PEEK_MODE_SHORT |
Returns | |
---|---|
WatchFaceStyle.Builder |
setHideNotificationIndicator
WatchFaceStyle.Builder setHideNotificationIndicator (boolean hide)
Sets whether to hide the dot indicator that is displayed at the bottom of the watch face if
there are any unread notifications. The default value is false, but note that the dot will
not be displayed if the numerical unread count indicator is being shown (i.e. if getShowUnreadCountIndicator()
is true).
Parameters | |
---|---|
hide |
boolean |
Returns | |
---|---|
WatchFaceStyle.Builder |
setHotwordIndicatorGravity
WatchFaceStyle.Builder setHotwordIndicatorGravity (int hotwordIndicatorGravity)
This method is deprecated.
Wear 2.0 doesn't show hotword indication on the watch face
Sets position of hotword (OK Google) on the screen.
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)
This method is deprecated.
Wear 2.0 doesn't have peeking cards
Sets whether the first, peeking card should be opaque when the watch face is displayed.
Parameters | |
---|---|
peekOpacityMode |
int : must be either PEEK_OPACITY_MODE_OPAQUE or PEEK_OPACITY_MODE_TRANSLUCENT |
Returns | |
---|---|
WatchFaceStyle.Builder |
setShowSystemUiTime
WatchFaceStyle.Builder setShowSystemUiTime (boolean showSystemUiTime)
This method is deprecated.
this will be removed in a future version of the Wear platform
Sets if the system will draw the system-style time over the watch face.
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)
Sets whether to add an indicator of how many unread cards there are in the stream. The indicator will be displayed next to status icons (battery state, lack of connection).
Parameters | |
---|---|
show |
boolean : if true an indicator will be shown
|
Returns | |
---|---|
WatchFaceStyle.Builder |
setStatusBarGravity
WatchFaceStyle.Builder setStatusBarGravity (int statusBarGravity)
Sets position of status icons (battery state, lack of connection) on the screen.
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)
This method is deprecated.
Use setViewProtectionMode(int)
instead.
Adds background color to UI elements of the home screen, so they are readable on the watch face. This should be used if the watch face color is close to being white.
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)
Adds background color to UI elements of the home screen, so they are readable on the watch face. This should be used if the watch face color is close to being white.
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 |