public static class

WatchFaceStyle.Builder

extends Object

Note: The Wearable Support Library classes under the android.support.wearable package are subject to change. For the full Android API reference, see Reference.

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

Class Overview

Builder for WatchFaceStyle objects.

Summary

Public Constructors
WatchFaceStyle.Builder(Service service)
Public Methods
WatchFaceStyle build()
Constructs read only WatchFaceStyle object.
WatchFaceStyle.Builder setAmbientPeekMode(int ambientPeekMode)
Sets how the first, peeking card will be displayed while the watch is in ambient, black & white mode.
WatchFaceStyle.Builder setBackgroundVisibility(int backgroundVisibility)
Set how to display background of the first, peeking card.
WatchFaceStyle.Builder setCardPeekMode(int peekMode)
Sets how far into the screen the first card will peek while the watch face is displayed.
WatchFaceStyle.Builder setHotwordIndicatorGravity(int hotwordIndicatorGravity)
Sets position of hotword (OK Google) on the screen.
WatchFaceStyle.Builder setPeekOpacityMode(int peekOpacityMode)
Sets whether the first, peeking card should be opaque when the watch face is displayed.
WatchFaceStyle.Builder setShowSystemUiTime(boolean showSystemUiTime)
Sets if the system will draw the system-style time over the watch face.
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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public WatchFaceStyle.Builder (Service service)

Public Methods

public WatchFaceStyle build ()

Constructs read only WatchFaceStyle object.

public WatchFaceStyle.Builder setAmbientPeekMode (int ambientPeekMode)

Sets how the first, peeking card will be displayed while the watch is in ambient, black & white mode.

Parameters
ambientPeekMode must be either AMBIENT_PEEK_MODE_VISIBLE or AMBIENT_PEEK_MODE_HIDDEN

public WatchFaceStyle.Builder setBackgroundVisibility (int backgroundVisibility)

Set how to display background of the first, peeking card.

Parameters
backgroundVisibility must be either BACKGROUND_VISIBILITY_INTERRUPTIVE or BACKGROUND_VISIBILITY_PERSISTENT

public WatchFaceStyle.Builder setCardPeekMode (int peekMode)

Sets how far into the screen the first card will peek while the watch face is displayed.

Parameters
peekMode must be either PEEK_MODE_VARIABLE or PEEK_MODE_SHORT

public WatchFaceStyle.Builder setHotwordIndicatorGravity (int hotwordIndicatorGravity)

Sets position of hotword (OK Google) on the screen.

Parameters
hotwordIndicatorGravity 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.

public WatchFaceStyle.Builder setPeekOpacityMode (int peekOpacityMode)

Sets whether the first, peeking card should be opaque when the watch face is displayed.

Parameters
peekOpacityMode must be either PEEK_OPACITY_MODE_OPAQUE or PEEK_OPACITY_MODE_TRANSLUCENT

public WatchFaceStyle.Builder setShowSystemUiTime (boolean showSystemUiTime)

Sets if the system will draw the system-style time over the watch face.

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

public 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 if true an indicator will be shown

public WatchFaceStyle.Builder setStatusBarGravity (int statusBarGravity)

Sets position of status icons (battery state, lack of connection) on the screen.

Parameters
statusBarGravity 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.

public 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 must be any combination of PROTECT_STATUS_BAR, PROTECT_HOTWORD_INDICATOR and PROTECT_WHOLE_SCREEN, e.g. PROTECT_STATUS_BAR | PROTECT_HOTWORD_INDICATOR

public 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 must be any combination of PROTECT_STATUS_BAR, PROTECT_HOTWORD_INDICATOR and PROTECT_WHOLE_SCREEN, e.g. PROTECT_STATUS_BAR | PROTECT_HOTWORD_INDICATOR