Open codezjx opened 9 years ago
Yes I have the same issue, and my Base.Theme is "Theme.AppCompat.Light.NoActionBar" and it's required to be that, because I use Material Design library Toolbar. Is there any way to fix this?
My stacktrace is:
android.content.res.Resources$NotFoundException: Resource is not a ColorStateList (color or path): TypedValue{t=0x2/d=0x7f010204 a=3}
at android.content.res.Resources.loadColorStateList(Resources.java:2068)
at android.content.res.TypedArray.getColorStateList(TypedArray.java:342)
at com.rey.material.app.Dialog.applyStyle(Dialog.java:251)
at com.rey.material.app.DatePickerDialog.applyStyle(DatePickerDialog.java:74)
at com.rey.material.app.Dialog.init(Dialog.java:176)
at com.rey.material.app.Dialog.
Looks like, it's casued by the default di_actionTextColor style property which in default refers to the theme, ?attr/colorControlActivated and it requires a colorStateList, and I only used a simple color in my theme. And it looks like, there are problems with attributes, which uses theme specific attribute refrences for ex: dp_headerPrimaryColor, dp_headerSecondaryColor, dp_selectionColor etc. uses "?attr/colorPrimary" in the Material.App.Dialog.DatePicker.Light style. So I define a custom style derived from the above, and overwrite these problematic attributes with direct color references.
android.content.res.Resources$NotFoundException: Resource is not a ColorStateList (color or path): TypedValue{t=0x2/d=0x7f0101bd a=6} at android.content.res.Resources.loadColorStateList(Resources.java:2337) at android.content.res.TypedArray.getColorStateList(TypedArray.java:343) at com.rey.material.app.Dialog.applyStyle(Dialog.java:207) at com.rey.material.app.DatePickerDialog.applyStyle(DatePickerDialog.java:74) at com.rey.material.app.Dialog.init(Dialog.java:160)
Show this crash error if my app don't use "Theme.AppCompat.Light.DarkActionBar", when I change to this, everything works fine. Why?