[ALOY-1090] Views XML: Support spaces in comma-separated lists of targets in the platform attribute
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-07-29T14:59:43.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.5.0 |
Components | XML |
Labels | 3.3.0.GA, alloy, qe-manualtest |
Reporter | Manuel Conde Vendrell |
Assignee | Feon Sua Xin Miao |
Created | 2014-07-18T11:05:48.000+0000 |
Updated | 2014-08-13T17:15:07.000+0000 |
Description
After one hour struggling my mind (since the update from 3.2.3 to 3.3.0) why the same code didn't work, I found a little bug, I suppose its in Alloy 1.4, because changing the SDK from 3.3.0 to 3.2.3 didn't work
<Alloy>
<Window platform="android, mobileweb" exitOnClose="true">
<Button bottom="5" width="Ti.UI.FILL">Click</Button>
</Window>
</Alloy>
For JS only $.index.open();
When compiling to Mobile Web it throws an error "undefined open".
The problem was the *space* between *android* and *mobileweb*. After delete it, all works. Previously to the update, the original code worked fine.
<Alloy>
<Window platform="android,mobileweb" exitOnClose="true">
<Button bottom="5" width="Ti.UI.FILL">Click</Button>
</Window>
</Alloy>
Someone have the same issue?.
[~ mcvendrell] In ALOY-1028 (and its linked ticket) we resolved an issue in which comma-separated platform lists were not actually being respected. In other words, in Alloy 1.3.1, the code was not properly parsed when you targeted multiple platforms and you could end up with non-platform-appropriate components in your app. So, we fixed that. However, as you note, the space in the string is now throwing our parser logic off track. I'm pretty sure our docs show no spaces. But really, we should be able to allow the spaces.
While the environment notes Windows, this is likely an issue on all operating systems and should be tested across all.
PR: https://github.com/appcelerator/alloy/pull/493 Test app: https://github.com/feons/alloy/tree/ALOY-1090/test/apps/testing/ALOY-1090 Functional Test: The sample app should compile and run with no error on ios, android and mobileweb. Note the spaces between the values of the platform attribute.
PR merged
Verified working as expected on iPhone 5 iOS 7.1.2, Nexus Galaxy 4.3, MobileWeb. TiSDK 3.4.0.v20140808101714 Appcelerator Studio 3.3.1.201408121314 Alloy 1.5.0-dev Closing