Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1042] Themes/Assets images not always correctly applied when using same theme for multiple platforms

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2014-08-28T16:33:59.000+0000
Affected Version/sAlloy 1.4.0, Alloy 1.3.1
Fix Version/sAlloy 1.5.0
ComponentsXML
Labelsqe-3.3.0, qe-manualtest
ReporterFederico Casali
AssigneeFeon Sua Xin Miao
Created2014-06-04T23:33:07.000+0000
Updated2014-08-28T21:10:57.000+0000

Description

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.

Attachments

FileDateSize
CorrectAssetMobileWeb.png2014-08-26T11:28:41.000+0000105434
screenshot1.png2014-06-04T23:33:07.000+000068771
screenshot2.png2014-06-04T23:43:25.000+000094618
screenshot3.png2014-06-04T23:43:25.000+0000102864
screenshot4.png2014-06-04T23:43:25.000+000081611
screenshot5.png2014-06-04T23:43:25.000+000040419
WrongAssetMobileWeb.png2014-08-26T11:28:41.000+000080710

Comments

  1. Feon Sua Xin Miao 2014-06-10

    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
  2. Tim Poulsen 2014-06-11

    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.
  3. Priya Agarwal 2014-08-26

    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.
  4. Feon Sua Xin Miao 2014-08-27

    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!
  5. Tim Poulsen 2014-08-28

    Works now in my testing. PRs merged
  6. Ewan Harris 2014-08-28

    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.

JSON Source