Skip to content

Most visited

Recently visited

navigation

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 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 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 setViewProtectionMode(int) instead.

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

From class java.lang.Object

Public constructors

WatchFaceStyle.Builder

WatchFaceStyle.Builder (Service service)

Parameters
service Service

Public methods

build

WatchFaceStyle build ()

Constructs read only WatchFaceStyle object.

Returns
WatchFaceStyle

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

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

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)