You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Androidplot 1.5.6
Google Pixel with Android 9 (API Level 28)
Compile SDK Version 26
Android Build tools 28.0.2
Stacktrace
Caused by: java.lang.IllegalArgumentException: Unknown color
at android.graphics.Color.parseColor(Color.java:1400)
at com.halfhp.fig.Fig.parseIntAttr(Fig.java:58)
at com.halfhp.fig.Fig.inflateParams(Fig.java:163)
at com.halfhp.fig.Fig.configure(Fig.java:283)
at com.halfhp.fig.Fig.configure(Fig.java:208)
at com.halfhp.fig.Fig.configure(Fig.java:234)
at com.halfhp.fig.Fig.configure(Fig.java:253)
at com.androidplot.ui.Formatter.configure(Formatter.java:52)
Notes
The issue appears to be caused by the following code in Fig.java
privatestaticintparseIntAttr(Stringvalue) {
if (Character.isDigit(value.charAt(0))) {
returnInteger.parseInt(value);
} elseif (value.startsWith(RESOURCE_ID_PREFIX)) {
// it's a resIdreturnColor.parseColor(value);
...
However, the Android Color.parseColor function does not accept resource IDs:
Thanks for the report - will investigate. Fig does in fact support the use of resource id's so off the top of my head I'm not sure where things are breaking here.
Summary
Applying a style where a color is specified as a resource ID causes an App using Android Plot to crash.
Expected Results
With a style resource such as
Applying the style in a formatter should apply the specified color resource.
Actual Results
Applying the style in a formatter causes the app to crash.
Steps to Reproduce
Reproduced in
Androidplot 1.5.6
Google Pixel with Android 9 (API Level 28)
Compile SDK Version 26
Android Build tools 28.0.2
Stacktrace
Notes
The issue appears to be caused by the following code in
Fig.java
However, the Android
Color.parseColor
function does not accept resource IDs:https://developer.android.com/reference/android/graphics/Color#parseColor(java.lang.String)
The text was updated successfully, but these errors were encountered: