# WatchFace.LegacyWatchFaceOverlayStyle

Artifact: [androidx.wear.watchface:watchface](https://developer.android.com/jetpack/androidx/releases/wear-watchface) [View Source](https://cs.android.com/search?q=file:androidx/wear/watchface/WatchFace.kt+class:androidx.wear.watchface.WatchFace.LegacyWatchFaceOverlayStyle) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

*** ** * ** ***

<br />

```
public final class WatchFace.LegacyWatchFaceOverlayStyle
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

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

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `https://developer.android.com/reference/androidx/wear/watchface/WatchFace.LegacyWatchFaceOverlayStyle#viewProtectionMode()` has an unexpected value |

## Summary

| ### Public constructors |
|---|
| `[LegacyWatchFaceOverlayStyle](https://developer.android.com/reference/androidx/wear/watchface/WatchFace.LegacyWatchFaceOverlayStyle#LegacyWatchFaceOverlayStyle(kotlin.Int,kotlin.Int,kotlin.Boolean,kotlin.Int))( int viewProtectionMode, int statusBarGravity, boolean tapEventsAccepted, @https://developer.android.com/reference/androidx/annotation/ColorInt int accentColor )` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

| ### Public methods |
|---|---|
| `final int` | `[getAccentColor](https://developer.android.com/reference/androidx/wear/watchface/WatchFace.LegacyWatchFaceOverlayStyle#getAccentColor())()` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final int` | `[getStatusBarGravity](https://developer.android.com/reference/androidx/wear/watchface/WatchFace.LegacyWatchFaceOverlayStyle#getStatusBarGravity())()` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final int` | `[getViewProtectionMode](https://developer.android.com/reference/androidx/wear/watchface/WatchFace.LegacyWatchFaceOverlayStyle#getViewProtectionMode())()` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final boolean` | `[isTapEventsAccepted](https://developer.android.com/reference/androidx/wear/watchface/WatchFace.LegacyWatchFaceOverlayStyle#isTapEventsAccepted())()` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

## Public constructors

### LegacyWatchFaceOverlayStyle

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
public [LegacyWatchFaceOverlayStyle](https://developer.android.com/reference/androidx/wear/watchface/WatchFace.LegacyWatchFaceOverlayStyle#LegacyWatchFaceOverlayStyle(kotlin.Int,kotlin.Int,kotlin.Boolean,kotlin.Int))(
    int viewProtectionMode,
    int statusBarGravity,
    boolean tapEventsAccepted,
    @ColorInt int accentColor
)
```

> [!CAUTION]
> **This method is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

| Parameters |
|---|---|
| `int viewProtectionMode` | The view protection mode bit field, must be a combination of zero or more of `https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceStyle.Companion.html#PROTECT_STATUS_BAR`, `https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceStyle.Companion.html#PROTECT_HOTWORD_INDICATOR`, `https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceStyle.Companion.html#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: (`https://developer.android.com/reference/android/view/Gravity.html#LEFT`, `https://developer.android.com/reference/android/view/Gravity.html#CENTER_HORIZONTAL`, `https://developer.android.com/reference/android/view/Gravity.html#RIGHT`) and vertical Gravity constants (`https://developer.android.com/reference/android/view/Gravity.html#TOP`, `https://developer.android.com/reference/android/view/Gravity.html#CENTER_VERTICAL`, `https://developer.android.com/reference/android/view/Gravity.html#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 `https://developer.android.com/reference/androidx/wear/watchface/TapType#DOWN()`, `https://developer.android.com/reference/androidx/wear/watchface/TapType#CANCEL()`, and `https://developer.android.com/reference/androidx/wear/watchface/TapType#UP()` events. |
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int accentColor` | The accent color which will be used when drawing the unread notification indicator. Default color is white. |

## Public methods

### getAccentColor

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
public final int [getAccentColor](https://developer.android.com/reference/androidx/wear/watchface/WatchFace.LegacyWatchFaceOverlayStyle#getAccentColor())()
```

> [!CAUTION]
> **This method is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

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

### getStatusBarGravity

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
public final int [getStatusBarGravity](https://developer.android.com/reference/androidx/wear/watchface/WatchFace.LegacyWatchFaceOverlayStyle#getStatusBarGravity())()
```

> [!CAUTION]
> **This method is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

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

### getViewProtectionMode

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
public final int [getViewProtectionMode](https://developer.android.com/reference/androidx/wear/watchface/WatchFace.LegacyWatchFaceOverlayStyle#getViewProtectionMode())()
```

> [!CAUTION]
> **This method is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

The view protection mode bit field, must be a combination of zero or more of `https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceStyle.Companion.html#PROTECT_STATUS_BAR`, `https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceStyle.Companion.html#PROTECT_HOTWORD_INDICATOR`, `https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceStyle.Companion.html#PROTECT_WHOLE_SCREEN`.

### isTapEventsAccepted

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.2.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
public final boolean [isTapEventsAccepted](https://developer.android.com/reference/androidx/wear/watchface/WatchFace.LegacyWatchFaceOverlayStyle#isTapEventsAccepted())()
```

> [!CAUTION]
> **This method is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Controls whether this watch face accepts tap events. Watchfaces that set this `true` are indicating they are prepared to receive `https://developer.android.com/reference/androidx/wear/watchface/TapType#DOWN()`, `https://developer.android.com/reference/androidx/wear/watchface/TapType#CANCEL()`, and `https://developer.android.com/reference/androidx/wear/watchface/TapType#UP()` events.