[TIMOB-15879] Android: Nine-patch images not displayed when placed in density-specific folder
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-12-05T07:21:56.000+0000 |
Affected Version/s | n/a |
Fix Version/s | 2013 Sprint 25, 2013 Sprint 25 Core, Release 3.2.0, Release 3.3.0 |
Components | Android |
Labels | module_imageview, nine-patch, qe-testadded, regression, triage |
Reporter | Fokke Zandbergen |
Assignee | Chris Barber |
Created | 2013-12-04T12:06:51.000+0000 |
Updated | 2014-07-29T20:36:18.000+0000 |
Description
To reproduce:
1. Create a project:ti create -p android -n nine --id test.nine -d .
2. Replace app.js code by:
var win = Titanium.UI.createWindow({
backgroundColor:'#fff'
});
var view = Ti.UI.createView({
width: 100,
height: 100,
backgroundImage: '/images/foo.png'
});
win.add(view);
win.open();
3. Place the attached (or any) image in /images/foo.9.png
4. Run the project to confirm it works.
5. Move the image to /android/images/foo.9.png
6. Run the project again to confirm it works.
5. Move the image to /android/images/res-mdpi/foo.9.png
(or any other density-specific folder)
6. Run the project again to confirm it does *not* work.
Attachments
File | Date | Size |
---|---|---|
foo.9.png | 2013-12-04T12:06:51.000+0000 | 8076 |
Thanks. Which version is this a regression against?
Works fine in 3.1.3.GA SDK and 3.1.2 CLI It might be more of a CLI problem? I should test 3.1.3.GA against 3.2.0-beta3 CLI then?
Yes, you should be able to test 3.1.3.GA SDK + 3.2.0-beta3 CLI.
* Verified working on 3.1.3.GA SDK + 3.2.0-beta CLI * Verified working on 3.1.3.GA SDK + 3.1.2 CLI * Verified broken on 3.2.0.v20131126144841 SDK + 3.2.0-beta CLI
So the cause seems to be the SDK, not the CLI.
Thanks. Moving to a SDK issue.
This is a CLI issue. Similar to TIMOB-10806, the hash of the nine-patch image is not calculated correctly. From the log
we can see we are looking for the image "foo_643a3006c7". But in the build/android/res/drawable-hdpi/ folder, the image name is "foo_cc63ca97ae.9.png" if using the master, while the image name is "foo_643a3006c7.9.png" if using 3.1.3.GA.
Master pull request: https://github.com/appcelerator/titanium_mobile/pull/5061 3.2.x pull request: https://github.com/appcelerator/titanium_mobile/pull/5062
Moved image foo.9.png to all three locations as above mentioned /images/foo.9.png /android/images/foo.9.png /android/images/res-mdpi/foo.9.png Image is getting displayed in all conditions. Verified fix on: Device : Google Nexus 7, Android Version: 4.3 SDK: 3.2.0.v20131204220843 CLI version : 3.2.0-beta OS : MAC OSX 10.9 Alloy: 1.3.0-beta ACS: 1.0.9 Appcelerator Studio, build: 3.2.0.201312042306 titanium-code-processor: 1.1.0-beta XCode : 5.0.2