In styles.xml :
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> ... <item name="android:datePickerStyle">@style/MyDatePickerStyle</item> </style> <style name="MyDatePickerStyle" parent="@android:style/Widget.DeviceDefault.DatePicker"> <item name="android:headerBackground">@color/red</item> <item name="android:headerMonthTextAppearance">@style/MyDatePickerTextAppearance</item> </style> <style name="MyDatePickerTextAppearance" parent="TextAppearance.AppCompat.Body1"> <item name="android:textColor">@drawable/my_color_state_list</item> </style>
range hood / my _color_state_list.xml
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:color="@color/yellow" android:state_selected="true"/> <item android:color="@color/purple" /> </selector>
If you also want to control the selected date color, add this theme to style.xml :
<style name="MyDatePickerTheme" parent="AppTheme"> <item name="colorAccent">@color/blue</item> </style>
In the layout:
<DatePicker android:theme="@style/MyDatePickerTheme" .../>
Result:

azizbekian
source share