daimajia / daimajia/NumberProgressBar

Android Studio 3.0 - InflateException

Open
#55 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6.1k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

I recently updated my working project to Android Studio 3 with all the latest repository versions and i ran into an issue with your library:

`android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class com.daimajia.numberprogressbar.NumberProgressBar Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class com.daimajia.numberprogressbar.NumberProgressBar`

`Caused by: java.lang.UnsupportedOperationException: Can't convert value at index 2 to color: type=0x5 at android.content.res.TypedArray.getColor(TypedArray.java:473) at com.daimajia.numberprogressbar.NumberProgressBar.(NumberProgressBar.java:185)`

Line 185:
`mUnreachedBarColor = attributes.getColor(R.styleable.NumberProgressBar_progress_unreached_color,default_unreached_color);`

I use your library as followed:
```

```

```

<item name="progress_reached_color">@color/colorPrimary</item>
<item name="progress_reached_bar_height">5dp</item>
<item name="progress_unreached_color">@android:color/transparent</item>
<item name="progress_text_color">@color/colorPrimary</item>
<item name="progress_text_size">5sp</item>

```

Removing the progress_unreached_color item does not work.
Changing the unreached color to `@color/white` for example does not work.

------

After further investigation i notice i cannot add two of your styling items:
**progress_text_color** & **progress_reached_bar_height**

When i set the other styling parameters, it works fine:

```

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at NumberProgressBar.java line 185 and inspect how the NumberProgressBar style attributes are read during XML inflation. Reproduce the failure with the provided NumberProgressBar_Custom style in Android Studio 3, focusing on progress_text_color and progress_reached_bar_height. Done means the custom style inflates without the reported InflateException while preserving the requested styling.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.