[TIMOB-18536] Can't use createDensityScaledBitmap() with 9-patch
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | 3.6.0, andoid |
Reporter | grebulon |
Assignee | Unknown |
Created | 2015-02-08T15:07:02.000+0000 |
Updated | 2018-02-28T19:55:10.000+0000 |
Description
I was looking at the upcoming code changes in the master branch, and noticed that in TiFileHelper$loadDrawable, at the code that handles 9-patch, you create the bitmap using TiUIHelper.createDensityScaledBitmap. Then you pass it to the 9-patch processor.
If the target density is changed, this will ruin the borders of the 9-patch and the processor will see it as a normal bitmap.
Noticed that this was somehow handled in the master branch but only for background property. The current "fix" won't work for ImageView src for example. My suggested fix for this problem (and the way I fixed it locally) is here: https://www.dropbox.com/s/slvy2dk07tb2pi3/TiFileHelper.java?dl=0