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 |
A style descriptor for watch faces.
Parameters here affect how IWatchFaceService will draw the system UI over a watch face.
An instance of this class should be passed in to setStyle(WatchFaceStyle) in the
onCreate
method of your watch face activity.
To construct a WatchFaceStyle use WatchFaceStyle.Builder
.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
WatchFaceStyle.Builder | Builder for WatchFaceStyle objects. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | AMBIENT_PEEK_MODE_HIDDEN | When this ambient mode is selected, the peek card will be hidden in ambient. | |||||||||
int | AMBIENT_PEEK_MODE_VISIBLE | When this ambient mode is selected, the peek card will be shown in ambient. | |||||||||
int | BACKGROUND_VISIBILITY_INTERRUPTIVE | When this background visibility is selected, the background of the peek card should only be shown briefly, and only if the peek card represents an interruptive notification. | |||||||||
int | BACKGROUND_VISIBILITY_PERSISTENT | When this background visibility is selected, the background of the peek card should always be shown. | |||||||||
int | PEEK_MODE_SHORT | When this peek mode is selected, peek cards will be a single line tall. | |||||||||
int | PEEK_MODE_VARIABLE | When this peek mode is selected, peek cards will be as tall as needed, while maintaining enough space at the top to draw the system time and status icons. | |||||||||
int | PEEK_OPACITY_MODE_OPAQUE | When this peek opacity is selected, the first card will be completely opaque when peeking. | |||||||||
int | PEEK_OPACITY_MODE_TRANSLUCENT | When this peek opacity is selected, the first card will be slightly translucent when peeking. | |||||||||
int | PROTECT_HOTWORD_INDICATOR | Whether to put a semi-transparent black background behind the "Ok Google" string to make it visible on a white background. | |||||||||
int | PROTECT_STATUS_BAR | Whether to put a semi-transparent black background behind the status bar to make it visible on white backgrounds. | |||||||||
int | PROTECT_WHOLE_SCREEN | Whether to dim the entire watch face background slightly so the time and icons are always visible. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Controls how the first, peeking card will be displayed while the watch is in ambient,
black & white mode.
| |||||||||||
Controls displaying background of the first, peeking card.
| |||||||||||
Controls how far into the screen the first card will peek while the watch face is displayed.
| |||||||||||
The component of the watch face activity whose style is being specified.
| |||||||||||
Controls position of hotword (OK Google) on the screen.
| |||||||||||
Controls whether the first, peeking card should be opaque when the watch face is displayed.
| |||||||||||
If true, the system will draw the system-style time over the watch face.
| |||||||||||
Whether to add an indicator of how many unread cards there are in the stream.
| |||||||||||
Controls position of status icons (battery state, lack of connection) on the screen.
| |||||||||||
Allows adding 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
| |||||||||||
From interface
android.os.Parcelable
|
When this ambient mode is selected, the peek card will be hidden in ambient.
When this ambient mode is selected, the peek card will be shown in ambient. This is the default mode.
When this background visibility is selected, the background of the peek card should only be shown briefly, and only if the peek card represents an interruptive notification.
When this background visibility is selected, the background of the peek card should always be shown. This is the default mode. Note that this will obscure your watch face whenever there is a peek card showing.
When this peek mode is selected, peek cards will be a single line tall.
When this peek mode is selected, peek cards will be as tall as needed, while maintaining enough space at the top to draw the system time and status icons. This is the default mode.
When this peek opacity is selected, the first card will be completely opaque when peeking. This is the default mode.
When this peek opacity is selected, the first card will be slightly translucent when peeking.
Whether to put a semi-transparent black background behind the "Ok Google" string to make it visible on a white background.
Whether to put a semi-transparent black background behind the status bar to make it visible on white backgrounds.
Whether to dim the entire watch face background slightly so the time and icons are always visible.
Controls how the first, peeking card will be displayed while the watch is in ambient,
black & white mode. Can be set to AMBIENT_PEEK_MODE_VISIBLE
or
AMBIENT_PEEK_MODE_HIDDEN
. AMBIENT_PEEK_MODE_VISIBLE
is the default value.
Controls displaying background of the first, peeking card. Can be set to either
BACKGROUND_VISIBILITY_INTERRUPTIVE
or BACKGROUND_VISIBILITY_PERSISTENT
.
BACKGROUND_VISIBILITY_INTERRUPTIVE
is the default value.
Controls how far into the screen the first card will peek while the watch face is displayed.
Can be set to either PEEK_MODE_VARIABLE
or PEEK_MODE_SHORT
.
PEEK_MODE_VARIABLE
is the default value.
The component of the watch face activity whose style is being specified.
Controls position of hotword (OK Google) on the screen. Can be set to 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.
Controls whether the first, peeking card should be opaque when the watch face is displayed.
Can be set to either PEEK_OPACITY_MODE_OPAQUE
or
PEEK_OPACITY_MODE_TRANSLUCENT
. PEEK_OPACITY_MODE_OPAQUE
is the default
value.
If true, the system will draw the system-style time over the watch face. By default it is set to false, which means you should draw or clearly represent the time on your watch face.
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). The default value is false.
Controls position of status icons (battery state, lack of connection) on the screen. Can be
set to 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.
Allows adding 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. This
can be set to any combination of PROTECT_STATUS_BAR
,
PROTECT_HOTWORD_INDICATOR
and PROTECT_WHOLE_SCREEN
, e.g.
PROTECT_STATUS_BAR | PROTECT_HOTWORD_INDICATOR
. The default value is no protection.