belongs to Maven artifact androidx.car:car:1.0.0-alpha1

DayNightStyle

public abstract @interface DayNightStyle
implements Annotation

androidx.car.widget.DayNightStyle


Specifies how the system UI should respond to day/night mode events.

By default, the Android Auto system UI assumes the app content background is light during the day and dark during the night. The system UI updates the foreground color (such as status bar icon colors) to be dark during day mode and light during night mode. By setting the DayNightStyle, the app can specify how the system should respond to a day/night mode event. For example, if the app has a dark content background for both day and night time, the app can tell the system to use FORCE_NIGHT style so the foreground color is locked to light color for both cases.

Note: Not all system UI elements can be customized with a DayNightStyle.

Summary

Constants

int AUTO

Sets the foreground color to be automatically changed based on day/night mode, assuming the app content background is light during the day and dark during the night.

int AUTO_INVERSE

Sets the foreground color to be automatically changed based on day/night mode, assuming the app content background is dark during the day and light during the night.

int FORCE_DAY

Sets the foreground color to be locked to the day version, which assumes the app content background is always light during both day and night.

int FORCE_NIGHT

Sets the foreground color to be locked to the night version, which assumes the app content background is always dark during both day and night.

Inherited methods

Constants

AUTO

int AUTO

Sets the foreground color to be automatically changed based on day/night mode, assuming the app content background is light during the day and dark during the night.

This is the default behavior.

Constant Value: 0 (0x00000000)

AUTO_INVERSE

int AUTO_INVERSE

Sets the foreground color to be automatically changed based on day/night mode, assuming the app content background is dark during the day and light during the night.

Constant Value: 1 (0x00000001)

FORCE_DAY

int FORCE_DAY

Sets the foreground color to be locked to the day version, which assumes the app content background is always light during both day and night.

Constant Value: 3 (0x00000003)

FORCE_NIGHT

int FORCE_NIGHT

Sets the foreground color to be locked to the night version, which assumes the app content background is always dark during both day and night.

Constant Value: 2 (0x00000002)