WatchFace.LegacyWatchFaceOverlayStyle

public final class WatchFace.LegacyWatchFaceOverlayStyle


Legacy Wear 2.0 watch face styling. These settings will be ignored on Wear 3.0 devices.

Throws
kotlin.IllegalArgumentException

if viewProtectionMode has an unexpected value

Summary

Public fields

final int

The accent color which will be used when drawing the unread notification indicator.

final int

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

final boolean

Controls whether this watch face accepts tap events.

final int

The view protection mode bit field, must be a combination of zero or more of WatchFaceStyle.PROTECT_STATUS_BAR, WatchFaceStyle.PROTECT_HOTWORD_INDICATOR, WatchFaceStyle.PROTECT_WHOLE_SCREEN.

Public constructors

LegacyWatchFaceOverlayStyle(
    int viewProtectionMode,
    int statusBarGravity,
    boolean tapEventsAccepted,
    @ColorInt int accentColor
)

Public fields

accentColor

@NonNull
public final int accentColor

The accent color which will be used when drawing the unread notification indicator. Default color is white.

statusBarGravity

@NonNull
public final int statusBarGravity

Controls the position of status icons (battery state, lack of connection) on the screen. This must be any combination of horizontal Gravity constant: (Gravity.LEFT, Gravity.CENTER_HORIZONTAL, Gravity.RIGHT) and vertical Gravity constants (Gravity.TOP, Gravity.CENTER_VERTICAL, Gravity.BOTTOM), e.g. [Gravity.LEFT] | [Gravity.BOTTOM]. On circular screens, only the vertical gravity is respected.

tapEventsAccepted

@NonNull
public final boolean tapEventsAccepted

Controls whether this watch face accepts tap events. Watchfaces that set this true are indicating they are prepared to receive TapType.DOWN, TapType.CANCEL, and TapType.UP events.

viewProtectionMode

@NonNull
public final int viewProtectionMode

The view protection mode bit field, must be a combination of zero or more of WatchFaceStyle.PROTECT_STATUS_BAR, WatchFaceStyle.PROTECT_HOTWORD_INDICATOR, WatchFaceStyle.PROTECT_WHOLE_SCREEN.

Public constructors

LegacyWatchFaceOverlayStyle

public final LegacyWatchFaceOverlayStyle(
    int viewProtectionMode,
    int statusBarGravity,
    boolean tapEventsAccepted,
    @ColorInt int accentColor
)
Parameters
int viewProtectionMode

The view protection mode bit field, must be a combination of zero or more of WatchFaceStyle.PROTECT_STATUS_BAR, WatchFaceStyle.PROTECT_HOTWORD_INDICATOR, WatchFaceStyle.PROTECT_WHOLE_SCREEN.

int statusBarGravity

Controls the position of status icons (battery state, lack of connection) on the screen. This must be any combination of horizontal Gravity constant: (Gravity.LEFT, Gravity.CENTER_HORIZONTAL, Gravity.RIGHT) and vertical Gravity constants (Gravity.TOP, Gravity.CENTER_VERTICAL, Gravity.BOTTOM), e.g. [Gravity.LEFT] | [Gravity.BOTTOM]. On circular screens, only the vertical gravity is respected.

boolean tapEventsAccepted

Controls whether this watch face accepts tap events. Watchfaces that set this true are indicating they are prepared to receive TapType.DOWN, TapType.CANCEL, and TapType.UP events.

@ColorInt int accentColor

The accent color which will be used when drawing the unread notification indicator. Default color is white.