Stay organized with collections
Save and categorize content based on your preferences.
UiModeManager.ContrastChangeListener
public
static
interface
UiModeManager.ContrastChangeListener
android.app.UiModeManager.ContrastChangeListener
|
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 UiModeManager.addContrastChangeListener(Executor, ContrastChangeListener)
.
Summary
Public methods |
abstract
void
|
onContrastChanged(float contrast)
Called when the color contrast enabled state changes.
|
Public methods
onContrastChanged
public abstract void onContrastChanged (float contrast)
Called when the color contrast enabled state changes.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# UiModeManager.ContrastChangeListener\n\nAdded in [API level 34](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nUiModeManager.ContrastChangeListener\n====================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/app/UiModeManager.ContrastChangeListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nUiModeManager.ContrastChangeListener\n`\n\n\n`\n\n\n`\n\n|--------------------------------------------------|\n| android.app.UiModeManager.ContrastChangeListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nListener for the UI contrast. To listen for changes to\nthe UI contrast on the device, implement this interface and\nregister it with the system by calling [UiModeManager.addContrastChangeListener(Executor, ContrastChangeListener)](/reference/android/app/UiModeManager#addContrastChangeListener(java.util.concurrent.Executor,%20android.app.UiModeManager.ContrastChangeListener)).\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onContrastChanged](/reference/android/app/UiModeManager.ContrastChangeListener#onContrastChanged(float))`(float contrast) ` Called when the color contrast enabled state changes. |\n\nPublic methods\n--------------\n\n### onContrastChanged\n\nAdded in [API level 34](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onContrastChanged (float contrast)\n```\n\nCalled when the color contrast enabled state changes.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `contrast` | `float`: The color contrast as in [UiModeManager.getContrast()](/reference/android/app/UiModeManager#getContrast()) Value is between -1.0f and 1.0f inclusive \u003cbr /\u003e |"]]