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.

Parameters
contrast float: The color contrast as in UiModeManager.getContrast()
Value is between -1.0f and 1.0f inclusive

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 2026-02-13 UTC.