Open Flamedek opened 8 years ago
Note that if I directly use SublimeDatePicker, the header background does work. But that doesn't seem to work on it's own.
SublimePicker
does not look for spHeaderBackground
. That's a job for SublimeDatePicker
. SublimePicker
can guide SublimeDatePicker
by providing spDatePickerStyle
:
<?xml version="1.0" encoding="utf-8"?>
<com.appeaser.sublimepickerlibrary.SublimePicker
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:spDatePickerStyle="@style/MyDatePickerStyle"
app:layout_gravity="center" >
</com.appeaser.sublimepickerlibrary.SublimePicker>
In your res/values/styles.xml
, define MyDatePickerStyle
:
<style name="MyDatePickerStyle" parent="SublimeDatePickerStyle">
<item name="spHeaderBackground">@color/colorPrimaryAlternative</item>
<item name="spHeaderTextColor">#fff</item>
<item name="spCalendarTextColor">@color/sp_primary_text_light</item>
</style>
I have the widget set up in a dialog, and all seems to work ok. However I can't get any of the colors to change. What I want is to replace all the 'android green' with a custom color. For this I inflate the view from xml with the following layout
None of the attributes, also ones not shown here, seem to have any effect. Note that if I directly use SublimeDatePicker, the header background does work. But that doesn't seem to work on it's own. Perhaps the attributes just don't get passed on correctly?