Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18536] Can't use createDensityScaledBitmap() with 9-patch

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labels3.6.0, andoid
Reportergrebulon
AssigneeUnknown
Created2015-02-08T15:07:02.000+0000
Updated2018-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.

Comments

  1. grebulon 2015-04-22

    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

JSON Source