Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

# UiModeManager.ContrastChangeListener

*** ** * ** ***


`
public
static


interface
UiModeManager.ContrastChangeListener
`


`


`

|---|
| android.app.UiModeManager.ContrastChangeListener |

<br />

*** ** * ** ***

Listener for the UI contrast. To listen for changes to
the UI contrast on the device, implement this interface and
register it with the system by calling `https://developer.android.com/reference/android/app/UiModeManager#addContrastChangeListener(java.util.concurrent.Executor,%20android.app.UiModeManager.ContrastChangeListener)`.

## Summary

| ### Public methods ||
|---|---|
| ` abstract void` | ` https://developer.android.com/reference/android/app/UiModeManager.ContrastChangeListener#onContrastChanged(float)(float contrast) ` Called when the color contrast enabled state changes. |

## Public methods

### onContrastChanged

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract void onContrastChanged (float contrast)
```

Called when the color contrast enabled state changes.

<br />

| Parameters ||
|---|---|
| `contrast` | `float`: The color contrast as in `https://developer.android.com/reference/android/app/UiModeManager#getContrast()` Value is between -1.0f and 1.0f inclusive <br /> |