[TIMOB-10806] Android: Ti.UI.Button.image property is not working for density specific images
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-11-13T23:38:54.000+0000 |
Affected Version/s | Release 2.1.2 |
Fix Version/s | Release 2.1.3, Release 3.0.0, Sprint 2012-19 API, 2012 Sprint 19, 2013 Sprint 23, 2013 Sprint 23 Core, Release 3.2.0 |
Components | Android |
Labels | SupportTeam, api, module_button, qe-closed-3.2.0, qe-port, qe-testadded |
Reporter | Varun Joshi |
Assignee | Chris Barber |
Created | 2012-09-06T15:22:16.000+0000 |
Updated | 2013-11-18T21:51:13.000+0000 |
Description
Issue
The Ti.UI.Button's image property does not work if the images are under the density specific Android image folders (res-port-hdpi etc.) It works if we put the image in the default image dir.Sample Test Case
1. Run the attached test project 2. The density specific images are placed under Resources/android/images folder. 3. In the sample code, if we swap the Ti.UI.Button with a view or an imageview, the appropriate images are used.Attachments
File | Date | Size |
---|---|---|
android_search.tiff | 2012-09-20T12:17:27.000+0000 | 6546 |
ios_search.tiff | 2012-09-20T12:17:27.000+0000 | 5880 |
T13975.zip | 2012-09-06T15:22:16.000+0000 | 2380189 |
timob10806.zip | 2012-09-10T13:53:03.000+0000 | 2392426 |
PR https://github.com/appcelerator/titanium_mobile/pull/2902 For functional test: 1. Download the attached test project "timob10806.zip". 2. Run the test project. Should see an image on the button. 3. Click the button. Should see the image is changed.
Also found in SDK 2.1.1.GA
PR for 2_1_X: https://github.com/appcelerator/titanium_mobile/pull/2968
Verified on: Titanium Studio: 2.1.2.201208301612 Titanium SDK: 2.1.3.v20120915120319 Android Device: Samsung Note (v2.3.6), Galaxy Nexus (v4.0.2)
Verified fix with: osx Mountain Lion 10.8.1 Titanium Studio, build: 2.1.2.201208301612 Titanium SDK: 2.1.3.v20120920154617 Titanium SDK: 3.0.0.v20120921144915 Device: Nexus S3 4.0.4
I am using SDK 3.13 and this bug still occurs in the emulator (e.g. WXGA720). However on a real device (Samsung Galaxy S3, same xhdpi) the button image is correctly loading from the density specific Android image folder. Is this only an emulator related bug or can this also happen on production release?
Tested with 3.1.3.GA. The image shows fine on emulator. But when tested with the latest master(3.2.0), this bug still occurs. The log is
In /build/android/res/drawable-xxx/, I can see the image file "tab1_94b63d84cf.png". But when I use 3.1.3.GA to build the project, I can see the image file "tab1_c9dd4dedd9.png". Seems the hash of the file are calculated differently in the master CLI. Re-opened the ticket. Seems like the same issue with TC-3259.
Pull request: https://github.com/appcelerator/titanium_mobile/pull/4961
Verified fixed on: Mac OSX 10.9 Mavericks Titanium Studio, build: 3.2.0.201311160316 Titanium SDK, build: 3.2.0.v20131117001643 CLI: 3.2.0-alpha Alloy: 1.3.0 Android Emulator: 2.3.3, 4.4 Android Device: Xperia Arc S (4.0.4) No error is thrown in the console log. Closing.