Problem description
On Android, using a conditional with negation is not working on 1.4.0.
Works fine using Alloy 1.3.1 so is a regression.
Steps to reproduce
The Journal sample app can be used to reproduce the issue.
1. Get the code from:
https://github.com/appcelerator/alloy/tree/master/test/apps/models/journal
2. Run on Android. Add an item.
Result: when adding an entry a runtime error is displayed (see screenshot).
3. Go to "views/add.xml" and change:
<Picker id="mood" platform="!ios">
to
<Picker id="mood" platform="android">
Run on Android and add an item
Result: item is added as expected.
Basically, using the conditional "!ios" is not working and the picker object was not being correctly created.
In part, this issue was caused by the change to fix ALOY-989. However, negation only ever worked in the XML. In other words, this would have worked prior to 989:
<View platform="!ios"/>
However, this would not have:"#someView\[platform=!ios]"
This fix submitted here enables negation in both XML and TSS, as well as supporting comma-separated lists of conditionals in both XML & TSS. PR https://github.com/appcelerator/alloy/pull/428 Functional test 1. Use the test app included with the PR. Labels in the app describe the XMLplatform
or TSS platform conditionals used. 2. Build for each of iOS, Android, and MobileWeb. You should see the number of labels as described in the app's output. 3. Compare the labels displayed with the XML/TSS selectors used in the app's codePR tested and merged
Verified fixed. Conditionals with negations works fine both when used into XML and TSS files for platform and formFactor queries. CustomTSS queries does not support conditionals with negation. TiSDK 3.3.0.v20140605150555 Alloy 1.4.0-beta2 Appcelerator Studio 3.3.0.201405271647 CLI 3.3.0-beta2 Closing.