DatePickerColors

Class

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

Represents the colors used by the date picker.

Parameters

containerColorthe color used for the date picker's background
titleContentColorthe color used for the date picker's title
headlineContentColorthe color used for the date picker's headline
weekdayContentColorthe color used for the weekday letters
subheadContentColorthe color used for the month and year subhead labels that appear when months are displayed at a DateRangePicker.
navigationContentColorthe content color used for the year selection menu button and the months arrow navigation when displayed at a DatePicker.
yearContentColorthe color used for a year item content
disabledYearContentColorthe color used for a disabled year item content
currentYearContentColorthe color used for the current year content when selecting a year
selectedYearContentColorthe color used for a selected year item content
disabledSelectedYearContentColorthe color used for a disabled selected year item content
selectedYearContainerColorthe color used for a selected year item container
disabledSelectedYearContainerColorthe color used for a disabled selected year item container
dayContentColorthe color used for days content
disabledDayContentColorthe color used for disabled days content
selectedDayContentColorthe color used for selected days content
disabledSelectedDayContentColorthe color used for disabled selected days content
selectedDayContainerColorthe color used for a selected day container
disabledSelectedDayContainerColorthe color used for a disabled selected day container
todayContentColorthe color used for the day that marks the current date
todayDateBorderColorthe color used for the border of the day that marks the current date
dayInSelectionRangeContentColorthe content color used for days that are within a date range selection
dayInSelectionRangeContainerColorthe container color used for days that are within a date range selection
dividerColorthe color used for the dividers used at the date pickers
dateTextFieldColorsthe TextFieldColors defaults for the date text field when in DisplayMode.Input. See OutlinedTextFieldDefaults.colors.

Functions

fun copy(
        containerColor: Color = this.containerColor,
        titleContentColor: Color = this.titleContentColor,
        headlineContentColor: Color = this.headlineContentColor,
        weekdayContentColor: Color = this.weekdayContentColor,
        subheadContentColor: Color = this.subheadContentColor,
        navigationContentColor: Color = this.navigationContentColor,
        yearContentColor: Color = this.yearContentColor,
        disabledYearContentColor: Color = this.disabledYearContentColor,
        currentYearContentColor: Color = this.currentYearContentColor,
        selectedYearContentColor: Color = this.selectedYearContentColor,
        disabledSelectedYearContentColor: Color = this.disabledSelectedYearContentColor,
        selectedYearContainerColor: Color = this.selectedYearContainerColor,
        disabledSelectedYearContainerColor: Color = this.disabledSelectedYearContainerColor,
        dayContentColor: Color = this.dayContentColor,
        disabledDayContentColor: Color = this.disabledDayContentColor,
        selectedDayContentColor: Color = this.selectedDayContentColor,
        disabledSelectedDayContentColor: Color = this.disabledSelectedDayContentColor,
        selectedDayContainerColor: Color = this.selectedDayContainerColor,
        disabledSelectedDayContainerColor: Color = this.disabledSelectedDayContainerColor,
        todayContentColor: Color = this.todayContentColor,
        todayDateBorderColor: Color = this.todayDateBorderColor,
        dayInSelectionRangeContainerColor: Color = this.dayInSelectionRangeContainerColor,
        dayInSelectionRangeContentColor: Color = this.dayInSelectionRangeContentColor,
        dividerColor: Color = this.dividerColor,
        dateTextFieldColors: TextFieldColors? = this.dateTextFieldColors,
    ) =
        DatePickerColors(
            containerColor.takeOrElse { this.containerColor },
            titleContentColor.takeOrElse { this.titleContentColor },
            headlineContentColor.takeOrElse { this.headlineContentColor },
            weekdayContentColor.takeOrElse { this.weekdayContentColor },
            subheadContentColor.takeOrElse { this.subheadContentColor },
            navigationContentColor.takeOrElse { this.navigationContentColor },
            yearContentColor.takeOrElse { this.yearContentColor },
            disabledYearContentColor.takeOrElse { this.disabledYearContentColor },
            currentYearContentColor.takeOrElse { this.currentYearContentColor },
            selectedYearContentColor.takeOrElse { this.selectedYearContentColor },
            disabledSelectedYearContentColor.takeOrElse { this.disabledSelectedYearContentColor },
            selectedYearContainerColor.takeOrElse { this.selectedYearContainerColor },
            disabledSelectedYearContainerColor.takeOrElse {
                this.disabledSelectedYearContainerColor
            },
            dayContentColor.takeOrElse { this.dayContentColor },
            disabledDayContentColor.takeOrElse { this.disabledDayContentColor },
            selectedDayContentColor.takeOrElse { this.selectedDayContentColor },
            disabledSelectedDayContentColor.takeOrElse { this.disabledSelectedDayContentColor },
            selectedDayContainerColor.takeOrElse { this.selectedDayContainerColor },
            disabledSelectedDayContainerColor.takeOrElse { this.disabledSelectedDayContainerColor },
            todayContentColor.takeOrElse { this.todayContentColor },
            todayDateBorderColor.takeOrElse { this.todayDateBorderColor },
            dayInSelectionRangeContainerColor.takeOrElse { this.dayInSelectionRangeContainerColor },
            dayInSelectionRangeContentColor.takeOrElse { this.dayInSelectionRangeContentColor },
            dividerColor.takeOrElse { this.dividerColor },
            dateTextFieldColors.takeOrElse { this.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"