Open 0megaD opened 6 years ago
Sorry, didn't see this message (apparently GitHub doesn't subscribe me to my own repo automatically...).
Well, the colorAccent
is coming from the theme (using ?colorAccent
). Maybe try using the theme
attribute instead of style
? Also, the com.takisoft.datetimepicker.widget.DatePicker
is a widget, not a dialog, so you should use Widget.Material.DatePicker
or Widget.Material.Light.DatePicker
as the parent.
Okay, so I checked out the things and here is the situation:
The day selector's color comes from Widget.Material.CalendarView
. If you check out out the styles_material.xml
file, you'll see that it has a dtp_daySelectorColor
attribute that sets it. This is set to ?attr/colorControlActivated
by default which gets set from the theme according to the accent color. You can try overriding the chain (style for the DatePicker
extending Widget.Material.DatePicker
-> set calendarViewStyle
to your style extending Widget.Material.CalendarView
-> dtp_daySelectorColor
) to achieve what you want or set the theme on the DatePicker
.
Thanks for your reply, I will try out your suggestions when I have the time. :)
I might be missing some nuance due to using this library, but I couldn't figure out how to override colorAccent.
The reason for this is because I want to change the color of the overall datepicker, without propagating those changes throughout the rest of the app.
Am I missing something or does this truly not work:
I also tried setting the style attributes from your readme, with similar results (or a lack of, rather)
An alternative would be to change all the colors of the datepicker manually, but I couldn't figure out the attribute for the selected day indicator, only for the other colored components.