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
containerColor | the color used for the date picker's background |
titleContentColor | the color used for the date picker's title |
headlineContentColor | the color used for the date picker's headline |
weekdayContentColor | the color used for the weekday letters |
subheadContentColor | the color used for the month and year subhead labels that appear when months are displayed at a DateRangePicker . |
navigationContentColor | the content color used for the year selection menu button and the months arrow navigation when displayed at a DatePicker . |
yearContentColor | the color used for a year item content |
disabledYearContentColor | the color used for a disabled year item content |
currentYearContentColor | the color used for the current year content when selecting a year |
selectedYearContentColor | the color used for a selected year item content |
disabledSelectedYearContentColor | the color used for a disabled selected year item content |
selectedYearContainerColor | the color used for a selected year item container |
disabledSelectedYearContainerColor | the color used for a disabled selected year item container |
dayContentColor | the color used for days content |
disabledDayContentColor | the color used for disabled days content |
selectedDayContentColor | the color used for selected days content |
disabledSelectedDayContentColor | the color used for disabled selected days content |
selectedDayContainerColor | the color used for a selected day container |
disabledSelectedDayContainerColor | the color used for a disabled selected day container |
todayContentColor | the color used for the day that marks the current date |
todayDateBorderColor | the color used for the border of the day that marks the current date |
dayInSelectionRangeContentColor | the content color used for days that are within a date range selection |
dayInSelectionRangeContainerColor | the container color used for days that are within a date range selection |
dividerColor | the color used for the dividers used at the date pickers |
dateTextFieldColors | the 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"