Problem description
Images included into Themes/Assets could not be correctly displayed when switching between different OS using the same theme.
Also reproducible with 1.3.1.GA so is not a regression.
(Note: using 1.4.0-beta , regression bug ALOY-1035 is present).
Steps to reproduce
Sample code for ALOY-577 can be used:
https://github.com/appcelerator/alloy/tree/1_4_X/test/apps/testing/ALOY-577
1. Import sample code in a new empty project and make sure no 'build' or 'resources' folder are present.
2. Build/run for MobileWeb
Result: App is built and runs fine. The "themes/
/assets" image is applied correctly. See screenshot1.png)
3. Build/run for Android
Result: App is built and runs. However, "themes//assets image" is not applied and the image included in the app/assets is used (see screenshot2.png)
Expected result: the image included in the "themes//assets" should be used.
4. Clean the project and run on Android
Result: app runs and "themes//assets" image is now displayed correctly. See screenshot3.png
5. Edit config.json and change the theme (in the example , from 'red' to 'blue'). Build/run on Android.
Result: app runs and "themes//assets" image is displayed correctly. See screenshot4.png
6. Build/run on MobileWeb
Result: the theme style is applied correctly (so the background color is blue), however the image displayed is the wrong one, still displaying the one relative to the previously used theme ('red'). See screenshot5.png
Additional note
From the testing, it seems that the bug is reproducible when the images are also present in the "app/assets" folder.
7. Remove 'red.png' and 'blue.png' images from "app/assets" folder and repeat steps from 1 to 6.
Result: in this case the "app/themes//assets" images are always displayed correctly.
PR: https://github.com/appcelerator/alloy/pull/441 Test app: https://github.com/appcelerator/alloy/tree/1_4_X/test/apps/testing/ALOY-577 Functional Test: 1. Follow the steps mentioned above 2. Verify theme asset images are displayed correctly
Tested and merged the PR. One note, I had to modify the ALOY-577 sample app to remove the leading slash from the image paths in order for the app to work on MobileWeb. With the slash present, the resulting web page was looking to http://localhost/red.png for the red image, for example.
Reopening the issue just for confirmation: Tested with environment: Appcelerator Studio: 3.4.0.201408251831 Sdk:3.4.0.v20140825141714 alloy:1.5.0-dev titanium:3.4.0-dev titanium-code-processor:1.1.1 acs:1.0.16 npm:1.3.2 OS:Maverick(10.9.4) xcode: Xcode6Beta6 Device:Nexus7(v4.3) Followed above steps: 1. Import sample code in a new empty project and make sure no 'build' or 'resources' folder are present. 2. Build/run for MobileWeb Result: App is built and runs fine. Getting screenshot1.png as expected. 3. Build/run for Android Result: App is built and runs. Getting screenshot 3.png as expected. 4. Clean the project and run on Android Result: App is built and runs. Getting screenshot 3.png as expected. 5. Edit config.json and change the theme (in the example , from 'red' to 'blue'). Build/run on Android. Result: App is built and runs. Getting screenshot 4.png as expected. 6. Build/run on MobileWeb Result: App is built and runs. Getting WrongAssetMobileWeb.png which is not expected. But on cleaning and building the app gain on mobileWeb. Getting CorrectAssetMobileWeb.png as expected which is correct.
master: https://github.com/appcelerator/alloy/pull/530 1_5_X: https://github.com/appcelerator/alloy/pull/531 [~skypanther] Could you take a look? Thank you!
Works now in my testing. PRs merged
Verified fix on: Mac OSX 10.9.4 Appcelerator Studio, build: 3.4.0.201408270900 Titanium SDK build: 3.4.0.v20140827165712 Titanium CLI, build: 3.4.0-dev Alloy: 1.5.0-dev Android Simulator 4.4.2 Android Device S5 (4.4.2) Mobileweb in Chrome 36.0.1985.135 on Samsung Galaxy S5 Followed the steps in the description; 1. Imported sample code into a new empty project and made sure no 'build' or 'resources' folder were present. 2. Build/run for MobileWeb Result: App is built and runs fine. Getting screenshot1.png as expected. 3. Build/run for Android Result: App is built and runs. Getting screenshot 3.png as expected. 4. Clean the project and run on Android Result: App is built and runs. Getting screenshot 3.png as expected. 5. Edit config.json and change the theme (in the example , from 'red' to 'blue'). Build/run on Android. Result: App is built and runs. Getting screenshot 4.png as expected. 6. Build/run on MobileWeb Result: App is built and runs. Getting CorrectAssetMobileWeb.png as expected. Closing ticket.