{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

DatePickerColors

@ExperimentalMaterial3Api
public final class DatePickerColors


Represents the colors used by the date picker.

Summary

Public constructors

DatePickerColors(
    @NonNull Color containerColor,
    @NonNull Color titleContentColor,
    @NonNull Color headlineContentColor,
    @NonNull Color weekdayContentColor,
    @NonNull Color subheadContentColor,
    @NonNull Color navigationContentColor,
    @NonNull Color yearContentColor,
    @NonNull Color disabledYearContentColor,
    @NonNull Color currentYearContentColor,
    @NonNull Color selectedYearContentColor,
    @NonNull Color disabledSelectedYearContentColor,
    @NonNull Color selectedYearContainerColor,
    @NonNull Color disabledSelectedYearContainerColor,
    @NonNull Color dayContentColor,
    @NonNull Color disabledDayContentColor,
    @NonNull Color selectedDayContentColor,
    @NonNull Color disabledSelectedDayContentColor,
    @NonNull Color selectedDayContainerColor,
    @NonNull Color disabledSelectedDayContainerColor,
    @NonNull Color todayContentColor,
    @NonNull Color todayDateBorderColor,
    @NonNull Color dayInSelectionRangeContainerColor,
    @NonNull Color dayInSelectionRangeContentColor,
    @NonNull Color dividerColor,
    @NonNull TextFieldColors dateTextFieldColors
)

create an instance with arbitrary colors, see DatePickerDefaults.colors for the default implementation that follows Material specifications.

Public methods

final @NonNull DatePickerColors
copy(
    @NonNull Color containerColor,
    @NonNull Color titleContentColor,
    @NonNull Color headlineContentColor,
    @NonNull Color weekdayContentColor,
    @NonNull Color subheadContentColor,
    @NonNull Color navigationContentColor,
    @NonNull Color yearContentColor,
    @NonNull Color disabledYearContentColor,
    @NonNull Color currentYearContentColor,
    @NonNull Color selectedYearContentColor,
    @NonNull Color disabledSelectedYearContentColor,
    @NonNull Color selectedYearContainerColor,
    @NonNull Color disabledSelectedYearContainerColor,
    @NonNull Color dayContentColor,
    @NonNull Color disabledDayContentColor,
    @NonNull Color selectedDayContentColor,
    @NonNull Color disabledSelectedDayContentColor,
    @NonNull Color selectedDayContainerColor,
    @NonNull Color disabledSelectedDayContainerColor,
    @NonNull Color todayContentColor,
    @NonNull Color todayDateBorderColor,
    @NonNull Color dayInSelectionRangeContainerColor,
    @NonNull Color dayInSelectionRangeContentColor,
    @NonNull Color dividerColor,
    TextFieldColors dateTextFieldColors
)

Returns a copy of this DatePickerColors, optionally overriding some of the values.

boolean
equals(Object other)
final @NonNull Color

the color used for the date picker's background

final @NonNull Color

the color used for the current year content when selecting a year

final @NonNull TextFieldColors

the TextFieldColors defaults for the date text field when in DisplayMode.Input.

final @NonNull Color

the color used for days content

final @NonNull Color

the container color used for days that are within a date range selection

final @NonNull Color

the content color used for days that are within a date range selection

final @NonNull Color

the color used for disabled days content

final @NonNull Color

the color used for a disabled selected day container

final @NonNull Color

the color used for disabled selected days content

final @NonNull Color

the color used for a disabled selected year item container

final @NonNull Color

the color used for a disabled selected year item content

final @NonNull Color

the color used for a disabled year item content

final @NonNull Color

the color used for the dividers used at the date pickers

final @NonNull Color

the color used for the date picker's headline

final @NonNull Color

the content color used for the year selection menu button and the months arrow navigation when displayed at a DatePicker.

final @NonNull Color

the color used for a selected day container

final @NonNull Color

the color used for selected days content

final @NonNull Color

the color used for a selected year item container

final @NonNull Color

the color used for a selected year item content

final @NonNull Color

the color used for the month and year subhead labels that appear when months are displayed at a DateRangePicker.

final @NonNull Color

the color used for the date picker's title

final @NonNull Color

the color used for the day that marks the current date

final @NonNull Color

the color used for the border of the day that marks the current date

final @NonNull Color

the color used for the weekday letters

final @NonNull Color

the color used for a year item content

int

Public constructors

DatePickerColors

public DatePickerColors(
    @NonNull Color containerColor,
    @NonNull Color titleContentColor,
    @NonNull Color headlineContentColor,
    @NonNull Color weekdayContentColor,
    @NonNull Color subheadContentColor,
    @NonNull Color navigationContentColor,
    @NonNull Color yearContentColor,
    @NonNull Color disabledYearContentColor,
    @NonNull Color currentYearContentColor,
    @NonNull Color selectedYearContentColor,
    @NonNull Color disabledSelectedYearContentColor,
    @NonNull Color selectedYearContainerColor,
    @NonNull Color disabledSelectedYearContainerColor,
    @NonNull Color dayContentColor,
    @NonNull Color disabledDayContentColor,
    @NonNull Color selectedDayContentColor,
    @NonNull Color disabledSelectedDayContentColor,
    @NonNull Color selectedDayContainerColor,
    @NonNull Color disabledSelectedDayContainerColor,
    @NonNull Color todayContentColor,
    @NonNull Color todayDateBorderColor,
    @NonNull Color dayInSelectionRangeContainerColor,
    @NonNull Color dayInSelectionRangeContentColor,
    @NonNull Color dividerColor,
    @NonNull TextFieldColors dateTextFieldColors
)

create an instance with arbitrary colors, see DatePickerDefaults.colors for the default implementation that follows Material specifications.

Parameters
@NonNull Color containerColor

the color used for the date picker's background

@NonNull Color titleContentColor

the color used for the date picker's title

@NonNull Color headlineContentColor

the color used for the date picker's headline

@NonNull Color weekdayContentColor

the color used for the weekday letters

@NonNull Color subheadContentColor

the color used for the month and year subhead labels that appear when months are displayed at a DateRangePicker.

@NonNull Color navigationContentColor

the content color used for the year selection menu button and the months arrow navigation when displayed at a DatePicker.

@NonNull Color yearContentColor

the color used for a year item content

@NonNull Color disabledYearContentColor

the color used for a disabled year item content

@NonNull Color currentYearContentColor

the color used for the current year content when selecting a year

@NonNull Color selectedYearContentColor

the color used for a selected year item content

@NonNull Color disabledSelectedYearContentColor

the color used for a disabled selected year item content

@NonNull Color selectedYearContainerColor

the color used for a selected year item container

@NonNull Color disabledSelectedYearContainerColor

the color used for a disabled selected year item container

@NonNull Color dayContentColor

the color used for days content

@NonNull Color disabledDayContentColor

the color used for disabled days content

@NonNull Color selectedDayContentColor

the color used for selected days content

@NonNull Color disabledSelectedDayContentColor

the color used for disabled selected days content

@NonNull Color selectedDayContainerColor

the color used for a selected day container

@NonNull Color disabledSelectedDayContainerColor

the color used for a disabled selected day container

@NonNull Color todayContentColor

the color used for the day that marks the current date

@NonNull Color todayDateBorderColor

the color used for the border of the day that marks the current date

@NonNull Color dayInSelectionRangeContainerColor

the container color used for days that are within a date range selection

@NonNull Color dayInSelectionRangeContentColor

the content color used for days that are within a date range selection

@NonNull Color dividerColor

the color used for the dividers used at the date pickers

@NonNull TextFieldColors dateTextFieldColors

the TextFieldColors defaults for the date text field when in DisplayMode.Input. See OutlinedTextFieldDefaults.colors.

Public methods

copy

public final @NonNull DatePickerColors copy(
    @NonNull Color containerColor,
    @NonNull Color titleContentColor,
    @NonNull Color headlineContentColor,
    @NonNull Color weekdayContentColor,
    @NonNull Color subheadContentColor,
    @NonNull Color navigationContentColor,
    @NonNull Color yearContentColor,
    @NonNull Color disabledYearContentColor,
    @NonNull Color currentYearContentColor,
    @NonNull Color selectedYearContentColor,
    @NonNull Color disabledSelectedYearContentColor,
    @NonNull Color selectedYearContainerColor,
    @NonNull Color disabledSelectedYearContainerColor,
    @NonNull Color dayContentColor,
    @NonNull Color disabledDayContentColor,
    @NonNull Color selectedDayContentColor,
    @NonNull Color disabledSelectedDayContentColor,
    @NonNull Color selectedDayContainerColor,
    @NonNull Color disabledSelectedDayContainerColor,
    @NonNull Color todayContentColor,
    @NonNull Color todayDateBorderColor,
    @NonNull Color dayInSelectionRangeContainerColor,
    @NonNull Color dayInSelectionRangeContentColor,
    @NonNull Color dividerColor,
    TextFieldColors dateTextFieldColors
)

Returns a copy of this DatePickerColors, optionally overriding some of the values. This uses the Color.Unspecified to mean “use the value from the source” // For dateTextFieldColors use null to mean "use the value from source"

equals

public boolean equals(Object other)

getContainerColor

public final @NonNull Color getContainerColor()

the color used for the date picker's background

getCurrentYearContentColor

public final @NonNull Color getCurrentYearContentColor()

the color used for the current year content when selecting a year

getDateTextFieldColors

public final @NonNull TextFieldColors getDateTextFieldColors()

the TextFieldColors defaults for the date text field when in DisplayMode.Input. See OutlinedTextFieldDefaults.colors.

getDayContentColor

public final @NonNull Color getDayContentColor()

the color used for days content

getDayInSelectionRangeContainerColor

public final @NonNull Color getDayInSelectionRangeContainerColor()

the container color used for days that are within a date range selection

getDayInSelectionRangeContentColor

public final @NonNull Color getDayInSelectionRangeContentColor()

the content color used for days that are within a date range selection

getDisabledDayContentColor

public final @NonNull Color getDisabledDayContentColor()

the color used for disabled days content

getDisabledSelectedDayContainerColor

public final @NonNull Color getDisabledSelectedDayContainerColor()

the color used for a disabled selected day container

getDisabledSelectedDayContentColor

public final @NonNull Color getDisabledSelectedDayContentColor()

the color used for disabled selected days content

getDisabledSelectedYearContainerColor

public final @NonNull Color getDisabledSelectedYearContainerColor()

the color used for a disabled selected year item container

getDisabledSelectedYearContentColor

public final @NonNull Color getDisabledSelectedYearContentColor()

the color used for a disabled selected year item content

getDisabledYearContentColor

public final @NonNull Color getDisabledYearContentColor()

the color used for a disabled year item content

getDividerColor

public final @NonNull Color getDividerColor()

the color used for the dividers used at the date pickers

getHeadlineContentColor

public final @NonNull Color getHeadlineContentColor()

the color used for the date picker's headline

getNavigationContentColor

public final @NonNull Color getNavigationContentColor()

the content color used for the year selection menu button and the months arrow navigation when displayed at a DatePicker.

getSelectedDayContainerColor

public final @NonNull Color getSelectedDayContainerColor()

the color used for a selected day container

getSelectedDayContentColor

public final @NonNull Color getSelectedDayContentColor()

the color used for selected days content

getSelectedYearContainerColor

public final @NonNull Color getSelectedYearContainerColor()

the color used for a selected year item container

getSelectedYearContentColor

public final @NonNull Color getSelectedYearContentColor()

the color used for a selected year item content

getSubheadContentColor

public final @NonNull Color getSubheadContentColor()

the color used for the month and year subhead labels that appear when months are displayed at a DateRangePicker.

getTitleContentColor

public final @NonNull Color getTitleContentColor()

the color used for the date picker's title

getTodayContentColor

public final @NonNull Color getTodayContentColor()

the color used for the day that marks the current date

getTodayDateBorderColor

public final @NonNull Color getTodayDateBorderColor()

the color used for the border of the day that marks the current date

getWeekdayContentColor

public final @NonNull Color getWeekdayContentColor()

the color used for the weekday letters

getYearContentColor

public final @NonNull Color getYearContentColor()

the color used for a year item content

hashCode

public int hashCode()